Skip to content

Commit b01c354

Browse files
committed
[Build] Simplify native build agent definition and platform list
1 parent 0960969 commit b01c354

File tree

1 file changed

+21
-30
lines changed

1 file changed

+21
-30
lines changed

Jenkinsfile

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,21 @@
1515
* Hannes Wellmann - Streamline entire SWT build and replace ANT-scripts by Maven, Jenkins-Pipeline and single-source Java scripts
1616
*******************************************************************************/
1717

18-
def nativeBuildAgent(String platform, Closure body) {
18+
def runOnNativeBuildAgent(String platform, Closure body) {
1919
def final nativeBuildStageName = 'Build SWT-native binaries'
2020
if (platform == 'gtk.linux.x86_64') {
21-
return podTemplate(yaml: '''
22-
apiVersion: v1
23-
kind: Pod
24-
spec:
25-
containers:
26-
- name: "swtbuild"
27-
image: "eclipse/platformreleng-centos-swt-build:8"
28-
imagePullPolicy: "Always"
29-
resources:
30-
limits:
31-
memory: "4096Mi"
32-
cpu: "2000m"
33-
requests:
34-
memory: "512Mi"
35-
cpu: "1000m"
36-
command:
37-
- cat
38-
tty: true
39-
volumeMounts:
40-
- name: tools
41-
mountPath: /opt/tools
42-
volumes:
43-
- name: tools
44-
persistentVolumeClaim:
45-
claimName: tools-claim-jiro-releng
46-
''') { node(POD_LABEL) { stage(nativeBuildStageName) { container('swtbuild') { body() } } } }
21+
podTemplate(inheritFrom: 'centos-latest' /* inhert general configuration */, containers: [
22+
containerTemplate(name: 'swtbuild', image: 'eclipse/platformreleng-centos-swt-build:8',
23+
resourceRequestCpu:'1000m', resourceRequestMemory:'512Mi',
24+
resourceLimitCpu:'2000m', resourceLimitMemory:'4096Mi',
25+
alwaysPullImage: true, command: 'cat', ttyEnabled: true)
26+
]) {
27+
node(POD_LABEL) { stage(nativeBuildStageName) { container('swtbuild') { body() } } }
28+
}
4729
} else {
48-
return node('native.builder-' + platform) { stage(nativeBuildStageName) { body() } }
30+
// See the Definition of the RelEng Jenkins instance in
31+
// https://github.com/eclipse-cbi/jiro/tree/master/instances/eclipse.platform.releng
32+
node('native.builder-' + platform) { stage(nativeBuildStageName) { body() } }
4933
}
5034
}
5135

@@ -197,7 +181,14 @@ pipeline {
197181
axes {
198182
axis {
199183
name 'PLATFORM'
200-
values 'cocoa.macosx.aarch64' , 'cocoa.macosx.x86_64', 'gtk.linux.aarch64', 'gtk.linux.ppc64le', 'gtk.linux.x86_64', 'win32.win32.aarch64', 'win32.win32.x86_64'
184+
values \
185+
'cocoa.macosx.aarch64',\
186+
'cocoa.macosx.x86_64',\
187+
'gtk.linux.aarch64',\
188+
'gtk.linux.ppc64le',\
189+
'gtk.linux.x86_64',\
190+
'win32.win32.aarch64',\
191+
'win32.win32.x86_64'
201192
}
202193
}
203194
stages {
@@ -214,7 +205,7 @@ pipeline {
214205
stash name:"jdk.resources.${os}.${arch}", includes: "include/,lib/"
215206
deleteDir()
216207
}
217-
nativeBuildAgent("${PLATFORM}") {
208+
runOnNativeBuildAgent("${PLATFORM}") {
218209
cleanWs() // Workspace is not cleaned up by default, so we do it explicitly
219210
echo "OS: ${os}, ARCH: ${arch}"
220211
unstash "swt.binaries.sources.${ws}"

0 commit comments

Comments
 (0)