diff options
author | Mickael Istria | 2021-07-14 08:57:27 +0000 |
---|---|---|
committer | Mickael Istria | 2021-07-16 22:09:01 +0000 |
commit | 3bbcbfe8bee49c3534434abf1407ef6c54bc31ed (patch) | |
tree | 3873d45adce135dc9b20f1f774c8365fba405ff2 | |
parent | 457de70f6333272fc1c975b39ccfa3d9edc3525b (diff) | |
download | rt.equinox.framework-3bbcbfe8bee49c3534434abf1407ef6c54bc31ed.tar.gz rt.equinox.framework-3bbcbfe8bee49c3534434abf1407ef6c54bc31ed.tar.xz rt.equinox.framework-3bbcbfe8bee49c3534434abf1407ef6c54bc31ed.zip |
Bug 574667 - Jenkinsfile to enable multibranch pipeline w/ GerritY20210722-0800Y20210720-0800Y20210719-0550I20210722-1800I20210721-1800I20210721-0530I20210720-1800I20210719-1800I20210718-1800I20210717-1800
Change-Id: Ide6ebc7485bc74bcc1522ddcf5634098b08de9cf
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/183048
Tested-by: Equinox Bot <equinox-bot@eclipse.org>
Reviewed-by: Mickael Istria <mistria@redhat.com>
-rw-r--r-- | Jenkinsfile | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..0db8ebf63 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,76 @@ +pipeline { + options { + timeout(time: 40, unit: 'MINUTES') + buildDiscarder(logRotator(numToKeepStr:'5')) + } + agent { + label "centos-latest" + } + tools { + maven 'apache-maven-latest' + jdk 'openjdk-jdk11-latest' + } + stages { + stage('initialize Gerrit review') { + steps { + gerritReview labels: [Verified: 0], message: "Build started $BUILD_URL" + } + } + stage('get binaries') { + steps{ + dir ('rt.equinox.binaries') { + checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', timeout: 120]], submoduleCfg: [], userRemoteConfigs: [[url: 'git://git.eclipse.org/gitroot/equinox/rt.equinox.binaries.git']]]) + } + } + } + stage('Build') { + steps { + sh """ + mvn clean verify --batch-mode --fail-at-end -Dmaven.repo.local=$WORKSPACE/.m2/repository \ + -Pbuild-individual-bundles -Pbree-libs -Papi-check \ + -DskipTests=false -Dmaven.compiler.failOnWarning=true \ + -Dcompare-version-with-baselines.skip=false \ + -Dproject.build.sourceEncoding=UTF-8 \ + -Drt.equinox.binaries.loc=$WORKSPACE/rt.equinox.binaries + """ + } + post { + always { + archiveArtifacts artifacts: '*.log,*/target/work/data/.metadata/*.log,*/tests/target/work/data/.metadata/*.log,apiAnalyzer-workspace/data/.metadata/*.log,*/apiAnalyzer-workspace/data/.metadata/*.log', allowEmptyArchive: true + junit '**/target/surefire-reports/TEST-*.xml' + publishIssues issues:[scanForIssues(tool: java()), scanForIssues(tool: mavenConsole())] + } + unstable { + gerritReview labels: [Verified: -1], message: "Build UNSTABLE (test failures) $BUILD_URL" + } + failure { + gerritReview labels: [Verified: -1], message: "Build FAILED $BUILD_URL" + } + } + } + stage('Check freeze period') { + when { + not { + branch 'master' + } + } + steps { + sh "wget https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/plain/scripts/verifyFreezePeriod.sh" + sh "chmod +x verifyFreezePeriod.sh" + withCredentials([string(credentialsId: 'google-api-key', variable: 'GOOGLE_API_KEY')]) { + sh './verifyFreezePeriod.sh' + } + } + post { + failure { + gerritReview labels: [Verified: -1], message: "Build and test are OK, but Eclipse project is currently in a code freeze period.\nPlease wait for end of code freeze period before merging.\n $BUILD_URL" + } + } + } + } + post { + success { + gerritReview labels: [Verified: 1], message: "Build Succcess $BUILD_URL" + } + } +} |