-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkins_multy_.groovy
37 lines (36 loc) · 1.14 KB
/
jenkins_multy_.groovy
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
podTemplate(yaml: '''
kind: Pod
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
imagePullPolicy: Always
command:
- sleep
args:
- 99d
- name: ubuntu
image: ubuntu:20.04
imagePullPolicy: Always
command:
- sleep
args:
- 99d
'''
) {
node(POD_LABEL) {
stage('Build with Kaniko') {
git branch: 'main', url: 'https://github.com/rpuserh/docker-test.git'
container('kaniko') {
//sh 'mkdir /kaniko/.docker || true'
//sh 'echo \'{ "credsStore": "ecr-login" }\' > /kaniko/.docker/config.json'
//sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --no-push'
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --destination=252072232973.dkr.ecr.us-east-1.amazonaws.com/app:$BUILD_NUMBER'
}
stage('other container')
container ('ubuntu') {
sh 'apt update ; ls '
}
}
}
}