diff --git a/configuration/pipelines/build.groovy b/configuration/pipelines/build.groovy index 57777f3..9930cd1 100644 --- a/configuration/pipelines/build.groovy +++ b/configuration/pipelines/build.groovy @@ -94,12 +94,8 @@ 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}" + executeShellScript("configuration/scripts/deployToKubernetes.sh", + env.APPLICATION_NAME) } } } diff --git a/configuration/scripts/deployToKubernetes.sh b/configuration/scripts/deployToKubernetes.sh old mode 100644 new mode 100755 index 20d602b..e49527e --- a/configuration/scripts/deployToKubernetes.sh +++ b/configuration/scripts/deployToKubernetes.sh @@ -1,2 +1,10 @@ #!/usr/bin/env bash +APPLICATION_NAME=$1 + +kubectl apply -f configuration/kubernetes/deployment.yaml +kubectl apply -f configuration/kubernetes/service.yaml + +kubectl get pods + +kubectl rollout status deployment/${APPLICATION_NAME} \ No newline at end of file