-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
52 lines (50 loc) · 1.19 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
podTemplate(yaml: '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: maven
image: maven:3.8.1-jdk-8
command:
- sleep
args:
- 99d
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
command:
- sleep
args:
- 9999999
volumeMounts:
- name: kaniko-secret
mountPath: /kaniko/.docker
restartPolicy: Never
volumes:
- name: kaniko-secret
secret:
secretName: dockercred
items:
- key: .dockerconfigjson
path: config.json
''') {
node(POD_LABEL) {
stage('Get Simple Hello World App') {
checkout scm
container('maven') {
stage('Test Hello World App') {
sh '''
echo "This could be a test"
'''
}
}
}
stage('Build Hello World App') {
container('kaniko') {
stage('Upload to DockerHub') {
sh "/kaniko/executor --context `pwd` --destination michaelcade1/90daysofdevops:${env.BUILD_ID}"
sh "/kaniko/executor --context `pwd` --destination michaelcade1/90daysofdevops:latest"
}
}
}
}
}