From 2559a35503176a3c6c9cf425226c577f1c04db0b Mon Sep 17 00:00:00 2001 From: Sciocatti Date: Sat, 7 Jan 2023 18:21:34 +0200 Subject: [PATCH] Updated Jenkinsfile to read branch name. --- cicd/Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cicd/Jenkinsfile b/cicd/Jenkinsfile index a9f0008..3d9a575 100644 --- a/cicd/Jenkinsfile +++ b/cicd/Jenkinsfile @@ -48,9 +48,7 @@ spec: stage('Docker Build and Push') { steps { container("kaniko") { - sh ''' - /kaniko/executor --dockerfile `pwd`/cicd/env.BRANCH_NAME/Dockerfile --context `pwd` --destination 192.168.195.195:30000/wedding-fe:env.BRANCH_NAME - ''' + sh '/kaniko/executor --dockerfile `pwd`/cicd/'+env.BRANCH_NAME+'}/Dockerfile --context `pwd` --destination 192.168.195.195:30000/wedding-fe:'+env.BRANCH_NAME } } } @@ -59,7 +57,7 @@ spec: container("deploy") { sh 'curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.24.3/bin/linux/arm64/kubectl"' sh 'chmod u+x ./kubectl' - sh 'sed -ie "s/{{replaceMe}}/`date +%s`/g" `pwd`/cicd/env.BRANCH_NAME/deployment.yaml' + sh 'sed -ie "s/{{replaceMe}}/`date +%s`/g" `pwd`/cicd/'+env.BRANCH_NAME+'/deployment.yaml' sh './kubectl replace -f `pwd`/cicd/`env.BRANCH_NAME`/deployment.yaml' } }