-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
28 lines (28 loc) · 1012 Bytes
/
Jenkinsfile
File metadata and controls
28 lines (28 loc) · 1012 Bytes
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
pipeline {
agent any
stages{
stage('build with kaniko'){
steps {
withKubeCredentials([
[credentialsId: 'jenkins-robot', namespace:'pg-dev']
]){
sh 'uname -a'
sh 'curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.20.5/bin/linux/amd64/kubectl"'
sh 'chmod u+x ./kubectl'
sh './kubectl apply -f kaniko.yaml'
sh 'sleep 400'
sh './kubectl delete pod \$(./kubectl get pods -n pg-dev | grep Completed | awk \'{print $1}\')'
}
}
}
stage('run kubectl'){
steps {
withKubeCredentials([
[credentialsId: 'jenkins-robot', namespace:'pg-dev']
]){
sh './kubectl rollout restart -n pg-dev deployment pg-deployment-web'
}
}
}
}
}