-
Notifications
You must be signed in to change notification settings - Fork 9
/
jenkins-pipeline
57 lines (53 loc) · 2.22 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
57
podTemplate(
activeDeadlineSeconds: 600, // 10m limit is more than enough
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-11-slim'}",
runAsUser: '0',
ttyEnabled: true,
command: 'cat',
resourceRequestCpu: '1',
resourceLimitCpu: '1',
resourceRequestMemory: '2Gi',
resourceLimitMemory: '2Gi'),
]
) {
node(POD_LABEL) {
stage("checkout") {
git branch: "${params.BRANCH ?: 'master'}",
url: 'https://github.com/Evolveum/midpoint-client-java'
}
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 -Dmaven.test.failure.ignore clean deploy
if [ '${params.VERBOSE}' = '1' ]
then
df -h
fi
"""
step([$class: 'Publisher', reportFilenamePattern: '**/testng-results.xml'])
}
}
}
}