Commit 5e3eab70 authored by Ishtiaq Ahmed's avatar Ishtiaq Ahmed

Update Jenkinsfile

parent 948aa213
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
maven 'Maven' maven 'Maven'
} }
stages { stages {
stage("git clone") { stage("Cloning Code- GitLab") {
steps { steps {
script { script {
echo "cloning my app" echo "cloning Code from GitLab"
sh "rm -rf *" sh "rm -rf *"
git branch: 'master', url: 'https://gitlab.mynisum.com/isahmed/nisum-cicd-task.git' git branch: 'master', url: 'https://gitlab.mynisum.com/isahmed/nisum-cicd-task.git'
} }
...@@ -22,31 +22,31 @@ ...@@ -22,31 +22,31 @@
} }
} }
stage("build jar") { stage("Code Build") {
steps { steps {
script { script {
echo "building application" echo "building application from code"
sh 'mvn clean package' sh 'mvn clean package'
sh 'mvn package' sh 'mvn package'
} }
} }
} }
stage("build docker") { stage("Image Build & Push") {
steps { steps {
script { script {
echo "building application" echo "building application"
withCredentials([usernamePassword(credentialsId: 'gitlab-ishtiaq', passwordVariable: 'PASS', usernameVariable: 'USER')]) { withCredentials([usernamePassword(credentialsId: 'gitlab-ishtiaq', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh "sed -i 's/VERSION/${env.BUILD_ID}/g' docker-build.sh" sh "sed -i 's/VERSION/${env.BUILD_ID}/g' docker-build.sh"
sh 'chmod 777 docker-build.sh' sh 'chmod +x docker-build.sh'
sh './docker-build.sh' sh './docker-build.sh'
} }
} }
} }
} }
stage("Deploy") { stage("Deployment on GKE") {
steps { steps {
sh "sed -i 's/VERSION/${env.BUILD_ID}/g' dep-nisum-cicd.yaml" sh "sed -i 's/VERSION/${env.BUILD_ID}/g' dep-nisum-cicd.yaml"
step([$class: 'KubernetesEngineBuilder', \ step([$class: 'KubernetesEngineBuilder', \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment