generated from Templates/html-nginx-deployment
Updated Jenkinsfile to read branch name.
Some checks failed
Home Cluster Builds/wedding-page/pipeline/head There was a failure building this commit
Some checks failed
Home Cluster Builds/wedding-page/pipeline/head There was a failure building this commit
This commit is contained in:
6
cicd/Jenkinsfile
vendored
6
cicd/Jenkinsfile
vendored
@@ -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'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user