-
Notifications
You must be signed in to change notification settings - Fork 69
/
Jenkinsfile
53 lines (51 loc) · 1.14 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
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 a Maven project') {
git url: 'https://github.com/scriptcamp/kubernetes-kaniko.git', branch: 'main'
container('maven') {
stage('Build a Maven project') {
sh '''
echo pwd
'''
}
}
}
stage('Build Java Image') {
container('kaniko') {
stage('Build a Go project') {
sh '''
/kaniko/executor --context `pwd` --destination bibinwilson/hello-kaniko:1.0
'''
}
}
}
}
}