Restart deployment when new image built (#2)
This commit is contained in:
parent
fc1066c455
commit
45049de87b
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@ -22,7 +22,23 @@ pipeline {
|
||||
container('docker') {
|
||||
sh """
|
||||
docker login docker.cloud.cluster.fun -u $DOCKER_CREDS_USR -p $DOCKER_CREDS_PSW
|
||||
docker tag docker.cloud.cluster.fun/averagemarcus/blog:${env.GIT_COMMIT} docker.cloud.cluster.fun/averagemarcus/blog:latest
|
||||
docker push docker.cloud.cluster.fun/averagemarcus/blog:${env.GIT_COMMIT}
|
||||
docker push docker.cloud.cluster.fun/averagemarcus/blog:latest
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Restart deployment') {
|
||||
when { branch 'master' }
|
||||
steps {
|
||||
container('kubectl') {
|
||||
sh """
|
||||
set +x
|
||||
mkdir -p ~/.kube/
|
||||
printf "\$CLOUD_KUBECONFIG" > ~/.kube/config
|
||||
kubectl --kubeconfig ~/.kube/config rollout restart deployment/blog --namespace default
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user