[19.02.20] Swapped Tag and deploy - as I don't want to send to repo if deploy failed as there would be something wrong with the image

This commit is contained in:
andyjk15 2020-02-19 16:52:15 +00:00
parent 2466780a50
commit 02199119f4
2 changed files with 9 additions and 11 deletions

View File

@ -72,6 +72,15 @@ try {
sh "cat configuration/kubernetes/deployment.yaml"
}
stage('Deploy') {
sh "kubectl apply -f configuration/kubernetes/deployment.yaml"
sh "kubectl apply -f configuration/kubernetes/service.yaml"
sh "kubectl get pods"
sh "kubectl rollout status deployment/${env.APPLICATION_NAME}"
}
stage('Tag Repository') {
withDockerServer([uri: "${env.DOCKER_REPOSITORY_TCP}"]) {
@ -83,15 +92,6 @@ try {
}
}
}
stage('Deploy') {
sh "kubectl apply -f configuration/kubernetes/deployment.yaml"
sh "kubectl apply -f configuration/kubernetes/service.yaml"
sh "kubectl get pods"
sh "kubectl rollout status deployment/${env.APPLICATION_NAME}"
}
}
}
} catch ( exception ) {

View File

@ -5,8 +5,6 @@ APPLICATION_NAME=$2
APPLICATION_VERSION=$3
APPLICATION_LABEL=$4
pwd
sed -i "s/REPOSITORY/${DOCKER_REPOSITORY}/g" configuration/kubernetes/deployment.yaml
sed -i "s/IMAGE/${APPLICATION_NAME}:${APPLICATION_VERSION}/g" configuration/kubernetes/deployment.yaml
sed -i "s/RESOURCE_NAME/${APPLICATION_NAME}/g" configuration/kubernetes/deployment.yaml