adding container kubectl to make this works
This commit is contained in:
parent
8f23cfe060
commit
cf44fe08ae
|
|
@ -79,13 +79,15 @@ spec:
|
|||
|
||||
stage('Deploy to Kubernetes') {
|
||||
steps {
|
||||
script {
|
||||
withCredentials([file(credentialsId: "${KUBE_CONFIG_ID}", variable: 'KUBE_CONFIG')]) {
|
||||
writeFile file: 'kubeconfig', text: KUBE_CONFIG
|
||||
sh """
|
||||
kubectl apply -f deploy/kubernetes/dev.yaml --kubeconfig=kubeconfig
|
||||
kubectl set image deployment/backend backend=${REGISTRY_URL}/${IMAGE_NAME}:dev-${env.SHORT_SHA} -n nam-backend-dev --kubeconfig=kubeconfig
|
||||
"""
|
||||
container('kubectl') {
|
||||
script {
|
||||
withCredentials([file(credentialsId: "${KUBE_CONFIG_ID}", variable: 'KUBE_CONFIG')]) {
|
||||
writeFile file: 'kubeconfig', text: KUBE_CONFIG
|
||||
sh """
|
||||
kubectl apply -f deploy/kubernetes/dev.yaml --kubeconfig=kubeconfig
|
||||
kubectl set image deployment/backend backend=${REGISTRY_URL}/${IMAGE_NAME}:dev-${env.SHORT_SHA} -n nam-backend-dev --kubeconfig=kubeconfig
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue