Updated Jenkinsfile to read branch name.
Some checks failed
Home Cluster Builds/wedding-page/pipeline/head There was a failure building this commit

This commit is contained in:
2023-01-07 18:21:34 +02:00
parent 8278950bf7
commit 2559a35503

6
cicd/Jenkinsfile vendored
View File

@@ -48,9 +48,7 @@ spec:
stage('Docker Build and Push') { stage('Docker Build and Push') {
steps { steps {
container("kaniko") { container("kaniko") {
sh ''' sh '/kaniko/executor --dockerfile `pwd`/cicd/'+env.BRANCH_NAME+'}/Dockerfile --context `pwd` --destination 192.168.195.195:30000/wedding-fe:'+env.BRANCH_NAME
/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") { container("deploy") {
sh 'curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.24.3/bin/linux/arm64/kubectl"' sh 'curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.24.3/bin/linux/arm64/kubectl"'
sh 'chmod u+x ./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' sh './kubectl replace -f `pwd`/cicd/`env.BRANCH_NAME`/deployment.yaml'
} }
} }