diff options
author | Mickael Istria | 2021-07-07 15:34:11 +0000 |
---|---|---|
committer | Mickael Istria | 2021-07-13 11:32:05 +0000 |
commit | 3e2b7500a985ecddb08f3a421fa9a80c058f4442 (patch) | |
tree | eb61ec86a077c97db8f23ab8012bb360af015ef8 | |
parent | 522a7a8f74e689900e28c557a5e1aed4fa0db899 (diff) | |
download | eclipse.platform.text-3e2b7500a985ecddb08f3a421fa9a80c058f4442.tar.gz eclipse.platform.text-3e2b7500a985ecddb08f3a421fa9a80c058f4442.tar.xz eclipse.platform.text-3e2b7500a985ecddb08f3a421fa9a80c058f4442.zip |
Bug 574667 - Use Jenkins multibranch pipeline based onY20210715-1150Y20210715-1000Y20210715-0820Y20210713-0800I20210716-0020I20210715-2200I20210715-1800I20210714-1800I20210713-1800
Jenkinsfile+Gerrit
Change-Id: I3f83202ca22241e3e0408ff7140240b11d3dad94
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/182860
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Mickael Istria <mistria@redhat.com>
-rw-r--r-- | Jenkinsfile | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000000..37ada0b7763 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,70 @@ +pipeline { + options { + timeout(time: 40, unit: 'MINUTES') + buildDiscarder(logRotator(numToKeepStr:'5')) + } + agent { + label "centos-7" + } + 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('Build') { + steps { + wrap([$class: 'Xvnc', useXauthority: true]) { + sh "metacity &" // needs to be in a "wrap Xvnc" block + sh """ + mvn clean verify --batch-mode --fail-at-end -Dmaven.repo.local=$WORKSPACE/.m2/repository \ + -Pbuild-individual-bundles -Pbree-libs -Papi-check \ + -Dcompare-version-with-baselines.skip=false \ + -Dproject.build.sourceEncoding=UTF-8 + """ + } + } + post { + always { + archiveArtifacts artifacts: '*.log,*/target/work/data/.metadata/*.log,*/tests/target/work/data/.metadata/*.log,apiAnalyzer-workspace/.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" + } + } +} |