Mickael Istria | e61be55 | 2021-07-14 22:52:36 +0200 | [diff] [blame] | 1 | pipeline { |
| 2 | options { |
| 3 | timeout(time: 40, unit: 'MINUTES') |
| 4 | buildDiscarder(logRotator(numToKeepStr:'5')) |
| 5 | } |
| 6 | agent { |
| 7 | label "centos-latest" |
| 8 | } |
| 9 | tools { |
| 10 | maven 'apache-maven-latest' |
| 11 | jdk 'openjdk-jdk11-latest' |
| 12 | } |
| 13 | stages { |
| 14 | stage('initialize Gerrit review') { |
| 15 | steps { |
| 16 | gerritReview labels: [Verified: 0], message: "Build started $BUILD_URL" |
| 17 | } |
| 18 | } |
| 19 | stage('Build') { |
| 20 | steps { |
| 21 | sh """ |
| 22 | mvn clean verify --batch-mode --fail-at-end -Dmaven.repo.local=$WORKSPACE/.m2/repository \ |
| 23 | -Pbuild-individual-bundles -Pbree-libs -Papi-check \ |
| 24 | -Dcompare-version-with-baselines.skip=false -Dcompare-version-with-baselines.skip=false \ |
| 25 | -Dproject.build.sourceEncoding=UTF-8 |
| 26 | """ |
| 27 | } |
| 28 | post { |
| 29 | always { |
| 30 | archiveArtifacts artifacts: '*.log,*/target/work/data/.metadata/*.log,*/tests/target/work/data/.metadata/*.log,apiAnalyzer-workspace/.metadata/*.log', allowEmptyArchive: true |
| 31 | junit '**/target/surefire-reports/TEST-*.xml' |
| 32 | publishIssues issues:[scanForIssues(tool: java()), scanForIssues(tool: mavenConsole())] |
| 33 | } |
| 34 | unstable { |
| 35 | gerritReview labels: [Verified: -1], message: "Build UNSTABLE (test failures) $BUILD_URL" |
| 36 | } |
| 37 | failure { |
| 38 | gerritReview labels: [Verified: -1], message: "Build FAILED $BUILD_URL" |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | stage('Check freeze period') { |
| 43 | when { |
| 44 | not { |
| 45 | branch 'master' |
| 46 | } |
| 47 | } |
| 48 | steps { |
| 49 | sh "wget https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/plain/scripts/verifyFreezePeriod.sh" |
| 50 | sh "chmod +x verifyFreezePeriod.sh" |
| 51 | withCredentials([string(credentialsId: 'google-api-key', variable: 'GOOGLE_API_KEY')]) { |
| 52 | sh './verifyFreezePeriod.sh' |
| 53 | } |
| 54 | } |
| 55 | post { |
| 56 | failure { |
| 57 | 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" |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | post { |
| 63 | success { |
| 64 | gerritReview labels: [Verified: 1], message: "Build Succcess $BUILD_URL" |
| 65 | } |
| 66 | } |
| 67 | } |