From 686cfcaddf8dc50f3f244209bc38195c136fc537 Mon Sep 17 00:00:00 2001 From: andyjk15 Date: Wed, 19 Feb 2020 18:45:20 +0000 Subject: [PATCH] [19.02.20] Script extraction for kube deployment and script permissions --- configuration/pipelines/build.groovy | 8 ++------ configuration/scripts/deployToKubernetes.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) mode change 100644 => 100755 configuration/scripts/deployToKubernetes.sh 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