forked from eclipse-platform/eclipse.platform.swt.binaries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
134 lines (134 loc) · 3.6 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
pipeline {
options {
skipDefaultCheckout() // Specialiced checkout is performed below
timestamps()
timeout(time: 90, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'5'))
disableConcurrentBuilds(abortPrevious: true)
}
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') {
dir ('eclipse.platform.swt') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']],
extensions: [[$class: 'CloneOption', timeout: 120]], userRemoteConfigs: [[url: 'https://github.com/eclipse-platform/eclipse.platform.swt.git']]
])
}
dir ('eclipse.platform.swt.binaries') {
checkout scm
}
}
}
}
stage('Build') {
steps {
container('container') {
wrap([$class: 'Xvnc', useXauthority: true]) {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk17-latest' }"]) {
dir ('eclipse.platform.swt.binaries') {
sh '''
/opt/tools/apache-maven/latest/bin/mvn install \
--batch-mode --no-transfer-progress \
-Pbuild-individual-bundles -DforceContextQualifier=zzz -Dnative=gtk.linux.x86_64 \
-Dcompare-version-with-baselines.skip=true -Dmaven.compiler.failOnWarning=true
'''
}
dir ('eclipse.platform.swt') {
sh '''
/opt/tools/apache-maven/latest/bin/mvn clean verify \
--batch-mode --no-transfer-progress \
-Pbuild-individual-bundles -DcheckAllWS=true -DforkCount=0 \
-Dcompare-version-with-baselines.skip=false -Dmaven.compiler.failOnWarning=true \
-Dmaven.test.failure.ignore=true -Dmaven.test.error.ignore=true
'''
}
}
}
}
}
post {
always {
junit '**/*.test*/target/surefire-reports/*.xml'
archiveArtifacts artifacts: '**/*.log,**/*.html,**/target/*.jar,**/target/*.zip'
publishIssues issues:[scanForIssues(tool: java()), scanForIssues(tool: mavenConsole())]
}
}
}
}
}