From 8e3438b94c11fcb1e764c1097fa9845c6bc5982a Mon Sep 17 00:00:00 2001 From: Amit Mandliya Date: Fri, 4 Nov 2022 10:13:24 -0400 Subject: [PATCH 1/4] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8bebc4571b..662215710f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,7 +40,7 @@ pipeline { echo 'Packaging vote app with docker' script{ docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') { - def voteImage = docker.build("xxxxxx/vote:v${env.BUILD_ID}", "./vote") + def voteImage = docker.build("amitmandliya/vote:v${env.BUILD_ID}", "./vote") voteImage.push() voteImage.push("dev") voteImage.push("latest") From 79a4611fe7670a1b1ef4df52e25f0f6911712980 Mon Sep 17 00:00:00 2001 From: Amit Mandliya Date: Fri, 4 Nov 2022 10:38:20 -0400 Subject: [PATCH 2/4] Update Jenkinsfile --- Jenkinsfile | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 662215710f..3464b0fc5c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,18 +34,24 @@ pipeline { } } } +// stage('Docker BnP'){ +// agent any +// steps{ +// echo 'Packaging vote app with docker' +// script{ +// docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') { +// def voteImage = docker.build("amitmandliya/vote:v${env.BUILD_ID}", "./vote") +// voteImage.push() +// voteImage.push("dev") +// voteImage.push("latest") +// } +// } +// } +// } stage('Docker BnP'){ agent any steps{ echo 'Packaging vote app with docker' - script{ - docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') { - def voteImage = docker.build("amitmandliya/vote:v${env.BUILD_ID}", "./vote") - voteImage.push() - voteImage.push("dev") - voteImage.push("latest") - } - } } } From 9480736c569b48c5cb195716ff1cca6f015cfadc Mon Sep 17 00:00:00 2001 From: Amit Mandliya Date: Fri, 4 Nov 2022 10:45:23 -0400 Subject: [PATCH 3/4] Added Jenkinsfile --- Jenkinsfile | 102 ++++++++++++++++++++++++---------------------------- 1 file changed, 47 insertions(+), 55 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3464b0fc5c..31377064a4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,67 +1,59 @@ pipeline { - agent none + stages { + stage('Build') { + agent { + docker { + image 'python:2.7.16-slim' + args '--user root' + } - - stages{ - stage('Build'){ - agent{ - docker{ - image 'python:2.7.16-slim' - args '--user root' - } - } - steps{ - echo 'Compiling vote app' - dir('vote'){ - sh 'pip install -r requirements.txt' - } - } + } + steps { + echo 'Compiling vote app' + dir(path: 'vote') { + sh 'pip install -r requirements.txt' + } } - stage('Unit Test'){ - agent{ - docker{ - image 'python:2.7.16-slim' - args '--user root' - } - } - steps{ - echo 'Running Unit Tests on vote app' - dir('vote'){ - sh 'pip install -r requirements.txt' - sh 'nosetests -v' - } - } + } + + stage('Unit Test') { + agent { + docker { + image 'python:2.7.16-slim' + args '--user root' + } + } -// stage('Docker BnP'){ -// agent any -// steps{ -// echo 'Packaging vote app with docker' -// script{ -// docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') { -// def voteImage = docker.build("amitmandliya/vote:v${env.BUILD_ID}", "./vote") -// voteImage.push() -// voteImage.push("dev") -// voteImage.push("latest") -// } -// } -// } -// } - stage('Docker BnP'){ - agent any - steps{ - echo 'Packaging vote app with docker' - } + steps { + echo 'Running Unit Tests on vote app' + dir(path: 'vote') { + sh 'pip install -r requirements.txt' + sh 'nosetests -v' + } + } + } - } + stage('Docker BnP') { + agent any + steps { + echo 'Packaging vote app with docker' + } + } - post{ - always{ - echo 'Pipeline for vote is complete..' + stage('test') { + steps { + sh 'echo "test"' + } } - + } + post { + always { + echo 'Pipeline for vote is complete..' + } -} + } +} \ No newline at end of file From 513dcaff88a48355202ac57d4b2f04320d3f5bbc Mon Sep 17 00:00:00 2001 From: Amit Mandliya Date: Fri, 4 Nov 2022 11:03:34 -0400 Subject: [PATCH 4/4] Update Jenkinsfile --- Jenkinsfile | 96 +++++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 31377064a4..8bebc4571b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,59 +1,61 @@ pipeline { - agent none - stages { - stage('Build') { - agent { - docker { - image 'python:2.7.16-slim' - args '--user root' - } - } - steps { - echo 'Compiling vote app' - dir(path: 'vote') { - sh 'pip install -r requirements.txt' - } + agent none - } - } - stage('Unit Test') { - agent { - docker { - image 'python:2.7.16-slim' - args '--user root' - } + stages{ + stage('Build'){ + agent{ + docker{ + image 'python:2.7.16-slim' + args '--user root' + } + } + steps{ + echo 'Compiling vote app' + dir('vote'){ + sh 'pip install -r requirements.txt' + } + } } - steps { - echo 'Running Unit Tests on vote app' - dir(path: 'vote') { - sh 'pip install -r requirements.txt' - sh 'nosetests -v' - } - + stage('Unit Test'){ + agent{ + docker{ + image 'python:2.7.16-slim' + args '--user root' + } + } + steps{ + echo 'Running Unit Tests on vote app' + dir('vote'){ + sh 'pip install -r requirements.txt' + sh 'nosetests -v' + } + } } - } - - stage('Docker BnP') { - agent any - steps { - echo 'Packaging vote app with docker' + stage('Docker BnP'){ + agent any + steps{ + echo 'Packaging vote app with docker' + script{ + docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') { + def voteImage = docker.build("xxxxxx/vote:v${env.BUILD_ID}", "./vote") + voteImage.push() + voteImage.push("dev") + voteImage.push("latest") + } + } + } } - } - - stage('test') { - steps { - sh 'echo "test"' - } - } } - post { - always { - echo 'Pipeline for vote is complete..' - } + post{ + always{ + echo 'Pipeline for vote is complete..' + } + } -} \ No newline at end of file + +}