-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile
90 lines (90 loc) · 1.93 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
pipeline {
agent {
kubernetes {
label 'rcptt-build-and-deploy-agent'
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: ubuntu
image: maven:3.9-eclipse-temurin-17-focal
tty: true
command:
- cat
resources:
limits:
memory: "4Gi"
cpu: "1"
requests:
memory: "4Gi"
cpu: "1"
env:
- name: "MAVEN_OPTS"
value: "-Duser.home=/home/jenkins"
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: jnlp
volumeMounts:
- name: volume-known-hosts
mountPath: /home/jenkins/.ssh
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: volume-known-hosts
configMap:
name: known-hosts
"""
}
}
stages {
stage('Checkout'){
steps {
checkout scm
}
}
stage('Build'){
steps {
container('ubuntu') {
sh 'mvn clean verify -X -Dmaven.repo.local=$WORKSPACE/m2 -e'
}
}
}
stage('Archive'){
steps {
archiveArtifacts allowEmptyArchive: true, artifacts: 'repository/target/repository/**/*'
}
}
}
}