-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
151 lines (151 loc) · 4.4 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
pipeline {
options {
timeout(time: 90, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'5'))
}
agent {
kubernetes {
label 'swtbuild-pod'
defaultContainer 'container'
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: jnlp
resources:
requests:
memory: "512Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
- name: container
image: akurtakov/swtbuild@sha256:2cd3dfdea1f250597c9e3797512953c03e2182344e86976c1b60117c5dd36a9e
tty: true
command: [ "uid_entrypoint", "cat" ]
resources:
requests:
memory: "4Gi"
cpu: "1"
limits:
memory: "4Gi"
cpu: "1"
volumeMounts:
- name: "settings-xml"
mountPath: "/home/jenkins/.m2/settings.xml"
subPath: "settings.xml"
readOnly: true
- name: "toolchains-xml"
mountPath: "/home/jenkins/.m2/toolchains.xml"
subPath: "toolchains.xml"
readOnly: true
- name: "settings-security-xml"
mountPath: "/home/jenkins/.m2/settings-security.xml"
subPath: "settings-security.xml"
readOnly: true
- name: m2-repo
mountPath: /home/jenkins/.m2/repository
- name: "tools"
mountPath: "/opt/tools"
volumes:
- name: settings-xml
secret:
secretName: m2-secret-dir
items:
- key: settings.xml
path: settings.xml
- name: toolchains-xml
configMap:
name: m2-dir
items:
- key: toolchains.xml
path: toolchains.xml
- name: settings-security-xml
secret:
secretName: m2-secret-dir
items:
- key: settings-security.xml
path: settings-security.xml
- name: m2-repo
emptyDir: {}
- name: tools
persistentVolumeClaim:
claimName: tools-claim-jiro-platform
"""
}
}
environment {
MAVEN_OPTS = "-Xmx4G"
}
stages {
stage('Prepare-environment') {
steps {
container('container') {
sh 'mutter --replace --sm-disable &'
dir ('eclipse.platform.swt') {
checkout scm
}
dir ('eclipse.platform.swt.binaries') {
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.binaries.git']]])
}
}
}
}
stage('Build') {
steps {
container('container') {
wrap([$class: 'Xvnc', useXauthority: true]) {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk11-latest' }"]) {
dir ('eclipse.platform.swt.binaries') {
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 '
}
dir ('eclipse.platform.swt') {
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 '
}
}
}
}
}
post {
always {
junit '**/*.test*/target/surefire-reports/*.xml'
archiveArtifacts artifacts: '**/*.log,**/*.html,**/target/*.jar,**/target/*.zip'
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 {
container('jnlp') {
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"
}
}
}