-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathjenkins-pipeline
56 lines (53 loc) · 2.16 KB
/
jenkins-pipeline
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
podTemplate(
activeDeadlineSeconds: 600, // 10m limit is more than enough for localization
idleMinutes: 1,
// Secret volume with maven settings.xml for deploy, see also sim-link in "build" stage.
volumes: [secretVolume(secretName: "jenkins-nexus",mountPath: "/root/jenkins-nexus")],
workspaceVolume: dynamicPVC(requestsSize: "5Gi"),
containers: [
containerTemplate(name: 'jnlp',
image: 'jenkins/inbound-agent:4.13-2-alpine',
runAsUser: '0',
resourceRequestCpu: '1',
resourceLimitCpu: '1',
resourceRequestMemory: '1Gi',
resourceLimitMemory: '1Gi'),
containerTemplate(name: 'maven',
image: params.BUILDER_IMAGE ?: 'maven:3.8.5-openjdk-17',
runAsUser: '0',
ttyEnabled: true,
command: 'cat',
resourceRequestCpu: '1',
resourceLimitCpu: '1',
resourceRequestMemory: '1Gi',
resourceLimitMemory: '1Gi'),
]
) {
node(POD_LABEL) {
stage("checkout") {
git branch: params.BRANCH ?: 'master',
url: 'https://github.com/Evolveum/midpoint-localization.git'
echo "git checkout done..."
}
stage("build") {
container('maven') {
sh """#!/bin/bash -ex
# .m2 is mutable and short-term, we just sym-link the settings.xml there.
mkdir -p /root/.m2
ln -s ../jenkins-nexus/settings.xml /root/.m2/settings.xml
if [ '${params.VERBOSE}' = '1' ]
then
env | sort
mvn --version
df -h
fi
mvn -B -ntp -DskipTests clean deploy
if [ '${params.VERBOSE}' = '1' ]
then
df -h
fi
"""
}
}
}
}