Mickael Istria | 6613c49 | 2021-07-09 15:43:08 +0200 | [diff] [blame] | 1 | pipeline { |
| 2 | options { |
| 3 | timeout(time: 90, unit: 'MINUTES') |
| 4 | buildDiscarder(logRotator(numToKeepStr:'5')) |
| 5 | } |
| 6 | agent { |
| 7 | kubernetes { |
| 8 | label 'swtbuild-pod' |
| 9 | defaultContainer 'container' |
| 10 | yaml """ |
| 11 | apiVersion: v1 |
| 12 | kind: Pod |
| 13 | spec: |
| 14 | containers: |
| 15 | - name: jnlp |
| 16 | resources: |
| 17 | requests: |
| 18 | memory: "512Mi" |
| 19 | cpu: "100m" |
| 20 | limits: |
| 21 | memory: "512Mi" |
| 22 | cpu: "500m" |
| 23 | - name: container |
| 24 | image: akurtakov/swtbuild@sha256:2cd3dfdea1f250597c9e3797512953c03e2182344e86976c1b60117c5dd36a9e |
| 25 | tty: true |
| 26 | command: [ "uid_entrypoint", "cat" ] |
| 27 | resources: |
| 28 | requests: |
| 29 | memory: "4Gi" |
| 30 | cpu: "1" |
| 31 | limits: |
| 32 | memory: "4Gi" |
| 33 | cpu: "1" |
| 34 | volumeMounts: |
| 35 | - name: "settings-xml" |
| 36 | mountPath: "/home/jenkins/.m2/settings.xml" |
| 37 | subPath: "settings.xml" |
| 38 | readOnly: true |
| 39 | - name: "toolchains-xml" |
| 40 | mountPath: "/home/jenkins/.m2/toolchains.xml" |
| 41 | subPath: "toolchains.xml" |
| 42 | readOnly: true |
| 43 | - name: "settings-security-xml" |
| 44 | mountPath: "/home/jenkins/.m2/settings-security.xml" |
| 45 | subPath: "settings-security.xml" |
| 46 | readOnly: true |
| 47 | - name: m2-repo |
| 48 | mountPath: /home/jenkins/.m2/repository |
| 49 | - name: "tools" |
| 50 | mountPath: "/opt/tools" |
| 51 | volumes: |
| 52 | - name: settings-xml |
| 53 | secret: |
| 54 | secretName: m2-secret-dir |
| 55 | items: |
| 56 | - key: settings.xml |
| 57 | path: settings.xml |
| 58 | - name: toolchains-xml |
| 59 | configMap: |
| 60 | name: m2-dir |
| 61 | items: |
| 62 | - key: toolchains.xml |
| 63 | path: toolchains.xml |
| 64 | - name: settings-security-xml |
| 65 | secret: |
| 66 | secretName: m2-secret-dir |
| 67 | items: |
| 68 | - key: settings-security.xml |
| 69 | path: settings-security.xml |
| 70 | - name: m2-repo |
| 71 | emptyDir: {} |
| 72 | - name: tools |
| 73 | persistentVolumeClaim: |
| 74 | claimName: tools-claim-jiro-platform |
| 75 | """ |
| 76 | } |
| 77 | } |
| 78 | environment { |
| 79 | MAVEN_OPTS = "-Xmx4G" |
| 80 | } |
| 81 | stages { |
| 82 | stage('Prepare-environment') { |
| 83 | steps { |
| 84 | container('container') { |
| 85 | sh 'mutter --replace --sm-disable &' |
| 86 | dir ('eclipse.platform.swt') { |
| 87 | checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', timeout: 120]], submoduleCfg: [], userRemoteConfigs: [[url: 'https://git.eclipse.org/r/platform/eclipse.platform.swt.git']]]) |
| 88 | } |
| 89 | dir ('eclipse.platform.swt.binaries') { |
| 90 | checkout scm |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | stage('Build') { |
| 96 | steps { |
| 97 | container('container') { |
| 98 | wrap([$class: 'Xvnc', useXauthority: true]) { |
| 99 | withEnv(["JAVA_HOME=${ tool 'openjdk-jdk11-latest' }"]) { |
| 100 | dir ('eclipse.platform.swt.binaries') { |
| 101 | sh '/opt/tools/apache-maven/latest/bin/mvn --batch-mode -Pbuild-individual-bundles -DforceContextQualifier=zzz -Dnative=gtk.linux.x86_64 -DskipJni -DskipRust -Dcompare-version-with-baselines.skip=true -Dmaven.compiler.failOnWarning=true install ' |
| 102 | } |
| 103 | dir ('eclipse.platform.swt') { |
| 104 | sh '/opt/tools/apache-maven/latest/bin/mvn --batch-mode -Pbuild-individual-bundles -DcheckAllWS=true -DforkCount=0 -Dcompare-version-with-baselines.skip=false -Dmaven.compiler.failOnWarning=true clean verify ' |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | post { |
| 111 | always { |
| 112 | junit '**/*.test*/target/surefire-reports/*.xml' |
| 113 | archiveArtifacts artifacts: '**/*.log,**/*.html,**/target/*.jar,**/target/*.zip' |
| 114 | publishIssues issues:[scanForIssues(tool: java()), scanForIssues(tool: mavenConsole())] |
| 115 | } |
| 116 | unstable { |
| 117 | gerritReview labels: [Verified: -1], message: "Build UNSTABLE (test failures) $BUILD_URL" |
| 118 | } |
| 119 | failure { |
| 120 | gerritReview labels: [Verified: -1], message: "Build FAILED $BUILD_URL" |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | stage('Check freeze period') { |
| 125 | when { |
| 126 | not { |
| 127 | branch 'master' |
| 128 | } |
| 129 | } |
| 130 | steps { |
| 131 | container('jnlp') { |
Alexander Kurtakov | ec8908c | 2022-02-09 21:34:46 +0200 | [diff] [blame] | 132 | sh "wget https://raw.githubusercontent.com/eclipse-platform/eclipse.platform.releng.aggregator/master/scripts/verifyFreezePeriod.sh" |
Mickael Istria | 6613c49 | 2021-07-09 15:43:08 +0200 | [diff] [blame] | 133 | sh "chmod +x verifyFreezePeriod.sh" |
| 134 | withCredentials([string(credentialsId: 'google-api-key', variable: 'GOOGLE_API_KEY')]) { |
| 135 | sh './verifyFreezePeriod.sh' |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | post { |
| 140 | failure { |
| 141 | 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" |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | post { |
| 147 | success { |
| 148 | gerritReview labels: [Verified: 1], message: "Build Succcess $BUILD_URL" |
| 149 | } |
| 150 | } |
| 151 | } |