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:25:25 +02:00
parent 2559a35503
commit bcc7434d7d

6
cicd/Jenkinsfile vendored
View File

@@ -8,7 +8,7 @@ pipeline {
apiVersion: v1
kind: Pod
metadata:
name: wedding-fe-env.BRANCH_NAME-build
name: wedding-fe-"""+BRANCH_NAME+"""-build
spec:
serviceAccountName: jenkins-admin
containers:
@@ -48,7 +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
}
}
}
@@ -58,7 +58,7 @@ spec:
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 './kubectl replace -f `pwd`/cicd/`env.BRANCH_NAME`/deployment.yaml'
sh './kubectl replace -f `pwd`/cicd/'+env.BRANCH_NAME+'/deployment.yaml'
}
}
}