From 2fbd98e34e86a164bfd309608649d7b4498467e4 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 09:41:03 +0100 Subject: [PATCH 01/95] Create jenkinsfile --- jenkinsfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 jenkinsfile diff --git a/jenkinsfile b/jenkinsfile new file mode 100644 index 00000000..e039a2e3 --- /dev/null +++ b/jenkinsfile @@ -0,0 +1,13 @@ + using hostname. + +[code language="java"] +node { + + withMaven(maven:'maven') { + stage ('Final') { + build job: 'customer-service-pipeline', wait: false + } + + } + +} From de72ef1961f682addc90c85c2b230c083537f935 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 09:43:09 +0100 Subject: [PATCH 02/95] Update jenkinsfile --- jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jenkinsfile b/jenkinsfile index e039a2e3..e0694618 100644 --- a/jenkinsfile +++ b/jenkinsfile @@ -3,6 +3,9 @@ [code language="java"] node { + stage('Checkout') { + git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' +} withMaven(maven:'maven') { stage ('Final') { build job: 'customer-service-pipeline', wait: false From 5ca79fb2b4b90ecbfaacc81df616be8d0ea71e16 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 09:45:26 +0100 Subject: [PATCH 03/95] Create Jenkinsfile --- .../github.com/piomin/Jenkinsfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 using hostname. -code language-java- node - stage-Checkout- - git url- -https/github.com/piomin/Jenkinsfile diff --git a/using hostname. -code language-java- node - stage-Checkout- - git url- -https/github.com/piomin/Jenkinsfile b/using hostname. -code language-java- node - stage-Checkout- - git url- -https/github.com/piomin/Jenkinsfile new file mode 100644 index 00000000..e0694618 --- /dev/null +++ b/using hostname. -code language-java- node - stage-Checkout- - git url- -https/github.com/piomin/Jenkinsfile @@ -0,0 +1,16 @@ + using hostname. + +[code language="java"] +node { + + stage('Checkout') { + git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' +} + withMaven(maven:'maven') { + stage ('Final') { + build job: 'customer-service-pipeline', wait: false + } + + } + +} From 37602a7614217cb23e7faf05075f4c0acf2db00e Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 09:48:30 +0100 Subject: [PATCH 04/95] Delete jenkinsfile --- jenkinsfile | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 jenkinsfile diff --git a/jenkinsfile b/jenkinsfile deleted file mode 100644 index e0694618..00000000 --- a/jenkinsfile +++ /dev/null @@ -1,16 +0,0 @@ - using hostname. - -[code language="java"] -node { - - stage('Checkout') { - git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' -} - withMaven(maven:'maven') { - stage ('Final') { - build job: 'customer-service-pipeline', wait: false - } - - } - -} From de9b3c0aac586a6b84529e42acc04da74ec9627f Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 09:48:58 +0100 Subject: [PATCH 05/95] Delete Jenkinsfile --- .../github.com/piomin/Jenkinsfile | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 using hostname. -code language-java- node - stage-Checkout- - git url- -https/github.com/piomin/Jenkinsfile diff --git a/using hostname. -code language-java- node - stage-Checkout- - git url- -https/github.com/piomin/Jenkinsfile b/using hostname. -code language-java- node - stage-Checkout- - git url- -https/github.com/piomin/Jenkinsfile deleted file mode 100644 index e0694618..00000000 --- a/using hostname. -code language-java- node - stage-Checkout- - git url- -https/github.com/piomin/Jenkinsfile +++ /dev/null @@ -1,16 +0,0 @@ - using hostname. - -[code language="java"] -node { - - stage('Checkout') { - git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' -} - withMaven(maven:'maven') { - stage ('Final') { - build job: 'customer-service-pipeline', wait: false - } - - } - -} From 8dbeddbe34e934d34d7a7c67ad071395669db8fe Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 09:49:25 +0100 Subject: [PATCH 06/95] Create Jenkinsfile --- Jenkinsfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..e0694618 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,16 @@ + using hostname. + +[code language="java"] +node { + + stage('Checkout') { + git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' +} + withMaven(maven:'maven') { + stage ('Final') { + build job: 'customer-service-pipeline', wait: false + } + + } + +} From 2ad48969a6b17c1859cf20069a42bc04509a6927 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 09:51:12 +0100 Subject: [PATCH 07/95] Update Jenkinsfile --- Jenkinsfile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e0694618..d612727b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,16 +1,6 @@ - using hostname. -[code language="java"] node { - - stage('Checkout') { - git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' -} - withMaven(maven:'maven') { stage ('Final') { build job: 'customer-service-pipeline', wait: false } - - } - } From 3d9636b02f122ec51048b7ff71a0e55d0d2d85bd Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 10:01:07 +0100 Subject: [PATCH 08/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d612727b..21a73176 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ node { stage ('Final') { - build job: 'customer-service-pipeline', wait: false + build job: '../customer-service', wait: false } } From f9dbacfdc9df72b48b502e89b6cd46a65a248106 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 10:05:49 +0100 Subject: [PATCH 09/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 21a73176..53ccb61d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ node { stage ('Final') { - build job: '../customer-service', wait: false + build job: '../customer-service/customer-service-pipeline', wait: false } } From eb9803cd1bba9a7c86477630f43b83cf4386a936 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 10:49:35 +0100 Subject: [PATCH 10/95] Update Jenkinsfile --- Jenkinsfile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 53ccb61d..86429311 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,2 @@ - -node { - stage ('Final') { - build job: '../customer-service/customer-service-pipeline', wait: false - } -} +def pipelineA = load "account-service/Jenkinsfile" +pipelineA.start() From 6c5ab3150aa6181a095423ddf6801065229f5ca7 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 10:58:11 +0100 Subject: [PATCH 11/95] Update Jenkinsfile --- Jenkinsfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 86429311..267b9b90 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,2 +1,9 @@ -def pipelineA = load "account-service/Jenkinsfile" -pipelineA.start() +node { + stage ('Final') { + steps { + echo "hello ${env.WORKSPACE}" + sh "ls ${env.WORKSPACE}" + build job: "${env.WORKSPACE}/account-service/Jenkinsfile" + } + } +} From 742648c41bd8ea5c307c502fd4b91c42ad8e71ac Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 10:59:38 +0100 Subject: [PATCH 12/95] Update Jenkinsfile --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 267b9b90..0fa50769 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,9 @@ node { stage ('Final') { steps { - echo "hello ${env.WORKSPACE}" - sh "ls ${env.WORKSPACE}" - build job: "${env.WORKSPACE}/account-service/Jenkinsfile" - } + echo "hello ${env.WORKSPACE}" + sh "ls ${env.WORKSPACE}" + build job: "${env.WORKSPACE}/account-service/Jenkinsfile" + } } } From d387e97378115bb0a5e62a6c593d8fd50807cdd6 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 11:56:06 +0100 Subject: [PATCH 13/95] Update Jenkinsfile --- Jenkinsfile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0fa50769..3a46f290 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,6 @@ node { - stage ('Final') { - steps { - echo "hello ${env.WORKSPACE}" - sh "ls ${env.WORKSPACE}" - build job: "${env.WORKSPACE}/account-service/Jenkinsfile" - } - } + stage ('Final') { + build job: '../account-service/account-service-pipeline', wait: false + } } + From 0a1f9b8542bca72f297b341974568bbbd0ef800f Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 11:57:13 +0100 Subject: [PATCH 14/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3a46f290..14055777 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ node { stage ('Final') { - build job: '../account-service/account-service-pipeline', wait: false + build job: '../account-service-pipeline', wait: false } } From 74aec9ece3fa175999f9ad21df0c5fd2e6b1b2c2 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 11:59:02 +0100 Subject: [PATCH 15/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 14055777..e9a227d8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ node { stage ('Final') { - build job: '../account-service-pipeline', wait: false + build job: '/account-service/account-service-pipeline', wait: false } } From 5d21038776e712cf95b2412f5b9ee5f4de62f836 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 11:59:57 +0100 Subject: [PATCH 16/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e9a227d8..2c22fa2b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ node { stage ('Final') { - build job: '/account-service/account-service-pipeline', wait: false + build job: './account-service/account-service-pipeline', wait: false } } From 7199050a9e9f727f176966e14024798f5b04d37c Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 12:01:03 +0100 Subject: [PATCH 17/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2c22fa2b..05e52f89 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ node { stage ('Final') { - build job: './account-service/account-service-pipeline', wait: false + build job: 'account-service-pipeline', wait: false } } From f5d8404014e8215021d50d5a7bce111691857e6b Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 19 Feb 2018 12:06:25 +0100 Subject: [PATCH 18/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 05e52f89..e01f3c8d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ node { stage ('Final') { - build job: 'account-service-pipeline', wait: false + build job: 'account-service', wait: false } } From 7beff81e41d0a10c121266e418ae90e01967753f Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 12:26:37 +0100 Subject: [PATCH 19/95] Update Jenkinsfile --- Jenkinsfile | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e01f3c8d..08ca97ad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,43 @@ -node { - stage ('Final') { - build job: 'account-service', wait: false +#!/usr/bin/env groovy +pipeline { + agent any + stages { + stage('Check for CHANGELOG update') { + when { expression { env.BRANCH_NAME != 'master' } } + steps { + script { + sshagent(['97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40']) { + sh "git config --add remote.origin.fetch +refs/heads/trunk:refs/remotes/origin/trunk" + sh "git fetch --no-tags" + List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/trunk..origin/${env.BRANCH_NAME}").split() + def isAccountChanged = false + def isCustomerChanged = false + def isDiscoveryChanged = false + def isGatewayChanged = false + for (int i = 0; i < sourceChanged.size(); i++) { + echo "** Here ***" + if (sourceChanged[i].contains("account")) { + isAccountChanged = true + } + if (sourceChanged[i].contains("customer")) { + isCustomerChanged = true + } + if (sourceChanged[i].contains("discovery")) { + isDiscoveryChanged = true + } + if (sourceChanged[i].contains("gateway")) { + isGatewayChanged = true + } + } + if (isAccountChanged == true) { + echo "** Entities changed ***" + } + if (isCustomerChanged == true) { + echo "** scheduler changed ***" + } + } + } + } + } } } - From 89dc6fe73933996779f69f9336c65de9e3f93d70 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 12:27:17 +0100 Subject: [PATCH 20/95] Update Jenkinsfile --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 08ca97ad..37aab26e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,10 +6,10 @@ pipeline { when { expression { env.BRANCH_NAME != 'master' } } steps { script { - sshagent(['97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40']) { - sh "git config --add remote.origin.fetch +refs/heads/trunk:refs/remotes/origin/trunk" + sshagent(['Credential Name']) { + sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" sh "git fetch --no-tags" - List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/trunk..origin/${env.BRANCH_NAME}").split() + List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/master..origin/${env.BRANCH_NAME}").split() def isAccountChanged = false def isCustomerChanged = false def isDiscoveryChanged = false From 7d68a784de1b7b26eba062289a0dcb8c7b8b267a Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 12:35:21 +0100 Subject: [PATCH 21/95] Update Jenkinsfile --- Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 37aab26e..b1183535 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,8 +7,6 @@ pipeline { steps { script { sshagent(['Credential Name']) { - sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" - sh "git fetch --no-tags" List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/master..origin/${env.BRANCH_NAME}").split() def isAccountChanged = false def isCustomerChanged = false From 197febae8e69669804286ed6168fe25af4b3d315 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 12:43:24 +0100 Subject: [PATCH 22/95] Update Jenkinsfile --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index b1183535..37aab26e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,6 +7,8 @@ pipeline { steps { script { sshagent(['Credential Name']) { + sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" + sh "git fetch --no-tags" List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/master..origin/${env.BRANCH_NAME}").split() def isAccountChanged = false def isCustomerChanged = false From 9bbd9e7d3c478ee95fb9a9b0660a2d809d787b53 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 14:29:22 +0100 Subject: [PATCH 23/95] Update Jenkinsfile --- Jenkinsfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 37aab26e..03f30762 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,6 +31,40 @@ pipeline { } if (isAccountChanged == true) { echo "** Entities changed ***" + node { + + withMaven(maven:'maven') { + + stage('Checkout') { + git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' + } + + stage('Build') { + sh 'mvn clean install' + + def pom = readMavenPom file:'pom.xml' + print pom.version + env.version = pom.version + } + + stage('Image') { + dir ('account-service') { + def app = docker.build "localhost:5000/account-service:${env.version}" + app.push() + } + } + + stage ('Run') { + docker.image("localhost:5000/account-service:${env.version}").run('-p 2222:2222 -h account --name account --link discovery') + } + + stage ('Final') { + build job: 'customer-service-pipeline', wait: false + } + + } + + } } if (isCustomerChanged == true) { echo "** scheduler changed ***" From a924bc54a9419047668e0fd3a6c63e6447b830cd Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 14:40:02 +0100 Subject: [PATCH 24/95] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 03f30762..ca2d689b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,7 +33,7 @@ pipeline { echo "** Entities changed ***" node { - withMaven(maven:'maven') { + stage('Checkout') { git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' @@ -62,7 +62,7 @@ pipeline { build job: 'customer-service-pipeline', wait: false } - } + } } From 9312a84105e55a387ac13274f86b01e9e2abefbd Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 14:53:08 +0100 Subject: [PATCH 25/95] Update Jenkinsfile --- Jenkinsfile | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ca2d689b..b8a86846 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,10 @@ #!/usr/bin/env groovy pipeline { agent any - stages { + stages { + stage('Checkout') { + git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' + } stage('Check for CHANGELOG update') { when { expression { env.BRANCH_NAME != 'master' } } steps { @@ -31,40 +34,39 @@ pipeline { } if (isAccountChanged == true) { echo "** Entities changed ***" - node { - stage('Checkout') { - git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' - } + stage('Checkout') { + git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' + } - stage('Build') { - sh 'mvn clean install' + stage('Build') { + sh 'mvn clean install' - def pom = readMavenPom file:'pom.xml' - print pom.version - env.version = pom.version - } + def pom = readMavenPom file:'pom.xml' + print pom.version + env.version = pom.version + } - stage('Image') { - dir ('account-service') { - def app = docker.build "localhost:5000/account-service:${env.version}" - app.push() - } - } + stage('Image') { + dir ('account-service') { + def app = docker.build "localhost:5000/account-service:${env.version}" + app.push() + } + } - stage ('Run') { - docker.image("localhost:5000/account-service:${env.version}").run('-p 2222:2222 -h account --name account --link discovery') - } + stage ('Run') { + docker.image("localhost:5000/account-service:${env.version}").run('-p 2222:2222 -h account --name account --link discovery') + } + + stage ('Final') { + build job: 'customer-service-pipeline', wait: false + } - stage ('Final') { - build job: 'customer-service-pipeline', wait: false - } - } } if (isCustomerChanged == true) { echo "** scheduler changed ***" From 546fd7695b144d696a89f04cdff84941345c6f90 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 14:57:08 +0100 Subject: [PATCH 26/95] Update Jenkinsfile --- Jenkinsfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b8a86846..b492f838 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,9 +2,6 @@ pipeline { agent any stages { - stage('Checkout') { - git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' - } stage('Check for CHANGELOG update') { when { expression { env.BRANCH_NAME != 'master' } } steps { @@ -34,7 +31,9 @@ pipeline { } if (isAccountChanged == true) { echo "** Entities changed ***" - + stage('Checkout') { + git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' + } stage('Checkout') { From 9b119be6f019d851607b77560e06bcea8b01e789 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 15:07:24 +0100 Subject: [PATCH 27/95] Update Jenkinsfile --- Jenkinsfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index b492f838..3d657f49 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,11 +41,15 @@ pipeline { } stage('Build') { + dir('account-service/') { + sh 'mvn clean install' def pom = readMavenPom file:'pom.xml' print pom.version env.version = pom.version + } + } stage('Image') { From 136ad0be3304aa004f8864f72075e426ffcf0228 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 15:10:33 +0100 Subject: [PATCH 28/95] Update Jenkinsfile --- Jenkinsfile | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3d657f49..a8de1a3c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,17 +40,6 @@ pipeline { git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' } - stage('Build') { - dir('account-service/') { - - sh 'mvn clean install' - - def pom = readMavenPom file:'pom.xml' - print pom.version - env.version = pom.version - } - - } stage('Image') { dir ('account-service') { @@ -63,10 +52,6 @@ pipeline { docker.image("localhost:5000/account-service:${env.version}").run('-p 2222:2222 -h account --name account --link discovery') } - stage ('Final') { - build job: 'customer-service-pipeline', wait: false - } - From 90b6a219e8d6ff5ae55f0285147e63fd5bcd690e Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 15:10:54 +0100 Subject: [PATCH 29/95] Update Jenkinsfile --- account-service/Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/account-service/Jenkinsfile b/account-service/Jenkinsfile index e2461c86..d4a3f3fc 100644 --- a/account-service/Jenkinsfile +++ b/account-service/Jenkinsfile @@ -33,5 +33,4 @@ node { } } - -} \ No newline at end of file +} From 9454657951a059989e47a4f1bc5c1c8ba28ce057 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 15:17:28 +0100 Subject: [PATCH 30/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a8de1a3c..9dc84648 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,7 +42,7 @@ pipeline { stage('Image') { - dir ('account-service') { + dir ('account-service/') { def app = docker.build "localhost:5000/account-service:${env.version}" app.push() } From ab2100e5c10aca6c737013f392b7a0b92fb66396 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 15:21:32 +0100 Subject: [PATCH 31/95] Update Jenkinsfile --- Jenkinsfile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9dc84648..9f62fe99 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,15 +41,9 @@ pipeline { } - stage('Image') { - dir ('account-service/') { - def app = docker.build "localhost:5000/account-service:${env.version}" - app.push() - } - } stage ('Run') { - docker.image("localhost:5000/account-service:${env.version}").run('-p 2222:2222 -h account --name account --link discovery') + echo "** RUN ***" } From 7ad6cdf5d9a16bf1b1658c114880e2fee0d974e3 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 15:31:28 +0100 Subject: [PATCH 32/95] Update Jenkinsfile --- Jenkinsfile | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9f62fe99..d48f26ce 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,32 +29,35 @@ pipeline { isGatewayChanged = true } } - if (isAccountChanged == true) { - echo "** Entities changed ***" - stage('Checkout') { - git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' - } + + } + } + } + } + stage('Check account') { + if (isAccountChanged == true) { + echo "** Entities changed ***" + stage('Checkout') { + git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' + } - stage('Checkout') { - git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' - } + stage('Checkout') { + git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' + } - stage ('Run') { - echo "** RUN ***" - } + stage ('Run') { + echo "** RUN ***" + } - } - if (isCustomerChanged == true) { - echo "** scheduler changed ***" - } - } - } + } + if (isCustomerChanged == true) { + echo "** scheduler changed ***" } } } From 809e2369f0576805111dc694b574c6552210641c Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 16:19:27 +0100 Subject: [PATCH 33/95] Update Jenkinsfile --- Jenkinsfile | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d48f26ce..a5fca455 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,35 +29,23 @@ pipeline { isGatewayChanged = true } } - - } - } - } - } - stage('Check account') { - if (isAccountChanged == true) { - echo "** Entities changed ***" - stage('Checkout') { - git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' - } + if (isAccountChanged == true) { + echo "** Entities changed ***" + + stage ('Run') { + docker.image("localhost:5000/account-service:${env.version}").run('-p 2222:2222 -h account --name account --link discovery') + } - stage('Checkout') { - git url: 'https://github.com/piomin/sample-spring-microservices.git', credentialsId: 'github-piomin', branch: 'master' - } - stage ('Run') { - echo "** RUN ***" + } + if (isCustomerChanged == true) { + echo "** scheduler changed ***" + } + } } - - - - - } - if (isCustomerChanged == true) { - echo "** scheduler changed ***" } } } From e29cb7132c1ba9979eb9ffccf01912e84c2c5e8a Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 16:23:01 +0100 Subject: [PATCH 34/95] Update Jenkinsfile --- Jenkinsfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a5fca455..33957941 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,10 +31,15 @@ pipeline { } if (isAccountChanged == true) { echo "** Entities changed ***" - + def jenkinsFile + stage('Loading Jenkins file') { + jenkinsFile = fileLoader.fromGit('testjenkinsstuff/cicd/testMyPipeline', 'https://github.myorg.com/user/testjenkinsstuff.git', 'master', null, '') + } + + jenkinsFile.start() stage ('Run') { - docker.image("localhost:5000/account-service:${env.version}").run('-p 2222:2222 -h account --name account --link discovery') + echo "**RUN ***" } From dac27b3f30292ce8488e46a3eb8dc8a6c904d5d9 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 16:34:35 +0100 Subject: [PATCH 35/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 33957941..4bfc2f6e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,7 +33,7 @@ pipeline { echo "** Entities changed ***" def jenkinsFile stage('Loading Jenkins file') { - jenkinsFile = fileLoader.fromGit('testjenkinsstuff/cicd/testMyPipeline', 'https://github.myorg.com/user/testjenkinsstuff.git', 'master', null, '') + jenkinsFile = fileLoader.fromGit('sample-spring-microservices/account-service/', 'https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') } jenkinsFile.start() From 7aacec5462b7057fa2a7666588b8d3a9b06e0302 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 17:05:29 +0100 Subject: [PATCH 36/95] Update Jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4bfc2f6e..fc0db569 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,8 +32,10 @@ pipeline { if (isAccountChanged == true) { echo "** Entities changed ***" def jenkinsFile + def jenkins stage('Loading Jenkins file') { - jenkinsFile = fileLoader.fromGit('sample-spring-microservices/account-service/', 'https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') + jenkins= fileLoader.fromGit('https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') + jenkinsFile = fileLoader.load('sample-spring-microservices/account-service/') } jenkinsFile.start() From 787d9084fbeb6662d609dfe0375a94cbbf18d350 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 17:12:09 +0100 Subject: [PATCH 37/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fc0db569..a7d1cffc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,7 +34,7 @@ pipeline { def jenkinsFile def jenkins stage('Loading Jenkins file') { - jenkins= fileLoader.fromGit('https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') + // jenkins= fileLoader.fromGit('https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') jenkinsFile = fileLoader.load('sample-spring-microservices/account-service/') } From 6919ff0c263553e17d2b612811bba6fd1f8e5f99 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 17:30:10 +0100 Subject: [PATCH 38/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a7d1cffc..9246cb95 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,7 +35,7 @@ pipeline { def jenkins stage('Loading Jenkins file') { // jenkins= fileLoader.fromGit('https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') - jenkinsFile = fileLoader.load('sample-spring-microservices/account-service/') + jenkinsFile = fileLoader.load('sample-spring-microservices/account-service') } jenkinsFile.start() From f481e1db850611b53aa02dc721f463ed84c678e8 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Tue, 20 Feb 2018 17:37:07 +0100 Subject: [PATCH 39/95] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9246cb95..7d30d749 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,9 +36,9 @@ pipeline { stage('Loading Jenkins file') { // jenkins= fileLoader.fromGit('https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') jenkinsFile = fileLoader.load('sample-spring-microservices/account-service') - } + jenkinsFile.start() - jenkinsFile.start() + } stage ('Run') { echo "**RUN ***" From a573b66f79f04a6f260ef4e0ff39d468a3f8f34c Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 21 Feb 2018 09:59:37 +0100 Subject: [PATCH 40/95] Update Jenkinsfile --- Jenkinsfile | 53 +++++++++++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7d30d749..1da85659 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,27 @@ #!/usr/bin/env groovy pipeline { - agent any - stages { - stage('Check for CHANGELOG update') { - when { expression { env.BRANCH_NAME != 'master' } } - steps { - script { + agent any + + stages { + + stage('test3') { + steps { + script { + if ( sendhipchat() == true) { + echo 'sendhipchat()' + echo 'account changed' + } else { + echo 'NO' + } + } + } + } + } +} +def sendhipchat() { + script { + if (env.BRANCH_NAME != 'master') { + echo 'I only execute on the master branch' sshagent(['Credential Name']) { sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" sh "git fetch --no-tags" @@ -29,31 +45,8 @@ pipeline { isGatewayChanged = true } } - if (isAccountChanged == true) { - echo "** Entities changed ***" - def jenkinsFile - def jenkins - stage('Loading Jenkins file') { - // jenkins= fileLoader.fromGit('https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') - jenkinsFile = fileLoader.load('sample-spring-microservices/account-service') - jenkinsFile.start() - - } - - stage ('Run') { - echo "**RUN ***" - } - - - - - } - if (isCustomerChanged == true) { - echo "** scheduler changed ***" - } } - } } } - } +return isAccountChanged } From 308210134ab5660b53ced0715bc4d26d2b73b257 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 21 Feb 2018 10:03:19 +0100 Subject: [PATCH 41/95] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 1da85659..20c60869 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,6 +26,7 @@ def sendhipchat() { sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" sh "git fetch --no-tags" List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/master..origin/${env.BRANCH_NAME}").split() + echo "** sourceChanged.size()***" def isAccountChanged = false def isCustomerChanged = false def isDiscoveryChanged = false From 3ccc18c589f886e296eaa477dda4840014be8fe2 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 21 Feb 2018 10:04:52 +0100 Subject: [PATCH 42/95] Update Jenkinsfile --- Jenkinsfile | 54 +++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 20c60869..7d30d749 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,32 +1,15 @@ #!/usr/bin/env groovy pipeline { - agent any - - stages { - - stage('test3') { - steps { - script { - if ( sendhipchat() == true) { - echo 'sendhipchat()' - echo 'account changed' - } else { - echo 'NO' - } - } - } - } - } -} -def sendhipchat() { - script { - if (env.BRANCH_NAME != 'master') { - echo 'I only execute on the master branch' + agent any + stages { + stage('Check for CHANGELOG update') { + when { expression { env.BRANCH_NAME != 'master' } } + steps { + script { sshagent(['Credential Name']) { sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" sh "git fetch --no-tags" List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/master..origin/${env.BRANCH_NAME}").split() - echo "** sourceChanged.size()***" def isAccountChanged = false def isCustomerChanged = false def isDiscoveryChanged = false @@ -46,8 +29,31 @@ def sendhipchat() { isGatewayChanged = true } } + if (isAccountChanged == true) { + echo "** Entities changed ***" + def jenkinsFile + def jenkins + stage('Loading Jenkins file') { + // jenkins= fileLoader.fromGit('https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') + jenkinsFile = fileLoader.load('sample-spring-microservices/account-service') + jenkinsFile.start() + + } + + stage ('Run') { + echo "**RUN ***" + } + + + + + } + if (isCustomerChanged == true) { + echo "** scheduler changed ***" + } } + } } } -return isAccountChanged + } } From e4c7720071458d87e0620c57f3c6fc93f67b05ca Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 21 Feb 2018 10:34:51 +0100 Subject: [PATCH 43/95] Update Jenkinsfile --- Jenkinsfile | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7d30d749..43d5e495 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,31 +29,37 @@ pipeline { isGatewayChanged = true } } - if (isAccountChanged == true) { + /* if (isAccountChanged == true) { echo "** Entities changed ***" def jenkinsFile def jenkins stage('Loading Jenkins file') { - // jenkins= fileLoader.fromGit('https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') + jenkins= fileLoader.fromGit('https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') jenkinsFile = fileLoader.load('sample-spring-microservices/account-service') jenkinsFile.start() - } - stage ('Run') { echo "**RUN ***" } - - - } if (isCustomerChanged == true) { echo "** scheduler changed ***" - } + }*/ + } + } + } + } + stage('Check') { + steps { + script { + if (isAccountChanged == true) { + echo "** Entities changed ***" } } } } + + } } From 7ece1ebaf784be154c13d90810410c473502667e Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 21 Feb 2018 10:37:33 +0100 Subject: [PATCH 44/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 43d5e495..0d9cc48a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -50,7 +50,7 @@ pipeline { } } } - stage('Check') { + stage 'Check' { steps { script { if (isAccountChanged == true) { From f751e0fecf2fdfdbedabce9dad75e2afdba019b1 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 21 Feb 2018 10:40:04 +0100 Subject: [PATCH 45/95] Update Jenkinsfile --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0d9cc48a..011dba03 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -50,9 +50,10 @@ pipeline { } } } - stage 'Check' { + stage ('Check') { steps { script { + echo "** stage check ***" if (isAccountChanged == true) { echo "** Entities changed ***" } From e793c4c280b3024bdd7d825f5a1d16566d498bb1 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 21 Feb 2018 10:48:28 +0100 Subject: [PATCH 46/95] Update Jenkinsfile --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 011dba03..b2078967 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,7 @@ #!/usr/bin/env groovy pipeline { agent any + def isAccountChanged = false stages { stage('Check for CHANGELOG update') { when { expression { env.BRANCH_NAME != 'master' } } @@ -54,7 +55,7 @@ pipeline { steps { script { echo "** stage check ***" - if (isAccountChanged == true) { + if ($isAccountChanged == true) { echo "** Entities changed ***" } } From 78d4ebe7ab7776fbe30790d8eb7ec8fb3ec424b2 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 21 Feb 2018 10:49:43 +0100 Subject: [PATCH 47/95] Update Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b2078967..46eab55c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,6 @@ #!/usr/bin/env groovy pipeline { agent any - def isAccountChanged = false stages { stage('Check for CHANGELOG update') { when { expression { env.BRANCH_NAME != 'master' } } From b383ffaf347eb06df0d39e051f65558eac1cd160 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 21 Feb 2018 10:56:32 +0100 Subject: [PATCH 48/95] Update Jenkinsfile --- Jenkinsfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 46eab55c..672d6308 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,12 @@ #!/usr/bin/env groovy pipeline { agent any + environment { + def isAccountChanged = false + def isCustomerChanged = false + def isDiscoveryChanged = false + def isGatewayChanged = false + } stages { stage('Check for CHANGELOG update') { when { expression { env.BRANCH_NAME != 'master' } } @@ -10,10 +16,10 @@ pipeline { sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" sh "git fetch --no-tags" List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/master..origin/${env.BRANCH_NAME}").split() - def isAccountChanged = false +/* def isAccountChanged = false def isCustomerChanged = false def isDiscoveryChanged = false - def isGatewayChanged = false + def isGatewayChanged = false*/ for (int i = 0; i < sourceChanged.size(); i++) { echo "** Here ***" if (sourceChanged[i].contains("account")) { @@ -54,7 +60,7 @@ pipeline { steps { script { echo "** stage check ***" - if ($isAccountChanged == true) { + if (isAccountChanged == true) { echo "** Entities changed ***" } } From 65bd63634fc42526f237256af9a91de3260a6619 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Fri, 23 Feb 2018 10:42:29 +0100 Subject: [PATCH 49/95] Update Jenkinsfile --- Jenkinsfile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 672d6308..77e7ae8e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -56,16 +56,14 @@ pipeline { } } } - stage ('Check') { - steps { - script { - echo "** stage check ***" - if (isAccountChanged == true) { - echo "** Entities changed ***" - } - } - } - } + stage('Build') { + dir('account-service') + sh 'mvn clean install' + def pom = readMavenPom file:'pom.xml' + print pom.version + env.version = pom.version +} + } } From ced37d47ccf1dba04d7c76e8eaf0cd90b1388c9a Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 13:38:34 +0100 Subject: [PATCH 50/95] Create script.sh --- account-service/script.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 account-service/script.sh diff --git a/account-service/script.sh b/account-service/script.sh new file mode 100644 index 00000000..14c87e3d --- /dev/null +++ b/account-service/script.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo "account-service" From d0ec203b1dd405bfa8cbb71146f34af0bd00680d Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 13:39:27 +0100 Subject: [PATCH 51/95] Create script.sh --- customer-service/script.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 customer-service/script.sh diff --git a/customer-service/script.sh b/customer-service/script.sh new file mode 100644 index 00000000..29beea0f --- /dev/null +++ b/customer-service/script.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo "customer-service" From 1672340bcee52f5996cf9fb4b6645059b892495d Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 14:05:52 +0100 Subject: [PATCH 52/95] Update Jenkinsfile --- Jenkinsfile | 87 +++++++++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 77e7ae8e..d7b03198 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,25 +1,14 @@ #!/usr/bin/env groovy -pipeline { - agent any - environment { - def isAccountChanged = false - def isCustomerChanged = false - def isDiscoveryChanged = false - def isGatewayChanged = false - } - stages { +def isAccountChanged = false +def isCustomerChanged = false +def isDiscoveryChanged = false +def isGatewayChanged = false +node { stage('Check for CHANGELOG update') { - when { expression { env.BRANCH_NAME != 'master' } } - steps { - script { sshagent(['Credential Name']) { sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" sh "git fetch --no-tags" List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/master..origin/${env.BRANCH_NAME}").split() -/* def isAccountChanged = false - def isCustomerChanged = false - def isDiscoveryChanged = false - def isGatewayChanged = false*/ for (int i = 0; i < sourceChanged.size(); i++) { echo "** Here ***" if (sourceChanged[i].contains("account")) { @@ -35,36 +24,48 @@ pipeline { isGatewayChanged = true } } - /* if (isAccountChanged == true) { - echo "** Entities changed ***" - def jenkinsFile - def jenkins - stage('Loading Jenkins file') { - jenkins= fileLoader.fromGit('https://github.com/saiida1/sample-spring-microservices.git', 'master', null, '') - jenkinsFile = fileLoader.load('sample-spring-microservices/account-service') - jenkinsFile.start() - } - stage ('Run') { - echo "**RUN ***" - } - } - if (isCustomerChanged == true) { - echo "** scheduler changed ***" - }*/ } } } + + stage('Test') { + + parallel ( + "account": { + + if (isAccountChanged == true) { + + node{ + + stage('checkout') { + + echo "** account ***" + + } + + } + + } + + }, + "Customer": { + + if (isCustomerChanged == true) { + + node{ + + stage('checkout') { + + echo "** customer ***" + + } + + } + + } + } - stage('Build') { - dir('account-service') - sh 'mvn clean install' - def pom = readMavenPom file:'pom.xml' - print pom.version - env.version = pom.version -} - } - - + ) } -} + From edfbad8f56b3eb7b7ef9bd081e0d65c0dd111820 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 14:41:58 +0100 Subject: [PATCH 53/95] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d7b03198..5d3da197 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,8 +6,8 @@ def isGatewayChanged = false node { stage('Check for CHANGELOG update') { sshagent(['Credential Name']) { - sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" - sh "git fetch --no-tags" + // sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" + //sh "git fetch --no-tags" List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/master..origin/${env.BRANCH_NAME}").split() for (int i = 0; i < sourceChanged.size(); i++) { echo "** Here ***" From 9a068698a78cbd06534374a5a7a3c62fd55567ec Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 14:52:47 +0100 Subject: [PATCH 54/95] Update Jenkinsfile --- Jenkinsfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5d3da197..ce3ae93b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,10 @@ def isCustomerChanged = false def isDiscoveryChanged = false def isGatewayChanged = false node { + stage('checkout') +{ +checkout scm +} stage('Check for CHANGELOG update') { sshagent(['Credential Name']) { // sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" From 06122a11b74bdaabbcd10185426410c26237ab7b Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:01:31 +0100 Subject: [PATCH 55/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ce3ae93b..d56be35f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ checkout scm sshagent(['Credential Name']) { // sh "git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master" //sh "git fetch --no-tags" - List sourceChanged = sh(returnStdout: true, script: "git diff --name-only origin/master..origin/${env.BRANCH_NAME}").split() + List sourceChanged = sh(returnStdout: true, script: "git diff --name-only HEAD^ origin/${env.BRANCH_NAME}").split() for (int i = 0; i < sourceChanged.size(); i++) { echo "** Here ***" if (sourceChanged[i].contains("account")) { From bcf4d81a86e1bfe3824ab89f15947524a0eed43a Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:16:43 +0100 Subject: [PATCH 56/95] Update Jenkinsfile --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d56be35f..9afc2b62 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ #!/usr/bin/env groovy -def isAccountChanged = false +def isAccountChanged = true def isCustomerChanged = false def isDiscoveryChanged = false def isGatewayChanged = false @@ -43,9 +43,9 @@ checkout scm node{ stage('checkout') { - - echo "** account ***" - + dir(account-service){ + sh "./script.sh " + } } } From b487f0ea3d209098268226d98abdf181cb30100f Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:19:47 +0100 Subject: [PATCH 57/95] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 9afc2b62..0f5c241b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,6 +44,7 @@ checkout scm stage('checkout') { dir(account-service){ + sh "chmod +x script.sh" sh "./script.sh " } } From 2d32f52c157a38116dfabf729574080844eaa770 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:22:45 +0100 Subject: [PATCH 58/95] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0f5c241b..086ed941 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,10 +43,10 @@ checkout scm node{ stage('checkout') { - dir(account-service){ + // dir(account-service){ sh "chmod +x script.sh" sh "./script.sh " - } + // } } } From 4778d86b18fde8e076293371530ed5ebdf00eeaa Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:25:41 +0100 Subject: [PATCH 59/95] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 086ed941..f5680874 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,10 +43,10 @@ checkout scm node{ stage('checkout') { - // dir(account-service){ + dir('account-service'){ sh "chmod +x script.sh" sh "./script.sh " - // } + } } } From 4a2f8a6a14785797c955008b6d67fc2c8bf6fe0f Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:27:57 +0100 Subject: [PATCH 60/95] Update script.sh --- account-service/script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account-service/script.sh b/account-service/script.sh index 14c87e3d..fcfb6d8b 100644 --- a/account-service/script.sh +++ b/account-service/script.sh @@ -1,2 +1,2 @@ #!/bin/sh -echo "account-service" +echo " yess yess account-service" From 75c5e65cba4d2ed4e6860b8d727f175187a39c46 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:29:30 +0100 Subject: [PATCH 61/95] Update script.sh --- customer-service/script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/customer-service/script.sh b/customer-service/script.sh index 29beea0f..a7d56ee9 100644 --- a/customer-service/script.sh +++ b/customer-service/script.sh @@ -1,2 +1,2 @@ #!/bin/sh -echo "customer-service" +echo " yessy yess customer-service" From 7f940144540a337cbe79b080243598af3bfca3be Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:30:35 +0100 Subject: [PATCH 62/95] Update Jenkinsfile --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f5680874..a9fdf38a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ #!/usr/bin/env groovy def isAccountChanged = true -def isCustomerChanged = false +def isCustomerChanged = true def isDiscoveryChanged = false def isGatewayChanged = false node { @@ -62,7 +62,10 @@ checkout scm stage('checkout') { - echo "** customer ***" + dir('customer-service'){ + sh "chmod +x script.sh" + sh "./script.sh " + } } From e8953a8c08d15fe749352f9b2d953c046cba1607 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:32:41 +0100 Subject: [PATCH 63/95] Create scrip.sh --- account-service/scrip.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 account-service/scrip.sh diff --git a/account-service/scrip.sh b/account-service/scrip.sh new file mode 100644 index 00000000..fbc4830c --- /dev/null +++ b/account-service/scrip.sh @@ -0,0 +1,2 @@ +#!/bin/sh +echo " yess yess account-service 2" From 3bc899ff9ddd783dbd9ff21da6aa577e24c114d1 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:33:10 +0100 Subject: [PATCH 64/95] Create scrip.sh --- customer-service/scrip.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 customer-service/scrip.sh diff --git a/customer-service/scrip.sh b/customer-service/scrip.sh new file mode 100644 index 00000000..d9ba90b6 --- /dev/null +++ b/customer-service/scrip.sh @@ -0,0 +1,3 @@ + +#!/bin/sh +echo " yess yess account-service 2 " From bceb06f07958fae47a3a3e55b692deee1e39f67d Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:35:33 +0100 Subject: [PATCH 65/95] Update Jenkinsfile --- Jenkinsfile | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a9fdf38a..9665eaeb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,14 +41,20 @@ checkout scm if (isAccountChanged == true) { node{ - - stage('checkout') { dir('account-service'){ + stage('checkout') { + sh "chmod +x script.sh" sh "./script.sh " - } + } + stage('scrip') { + sh "chmod +x scrip.sh" + sh "./scrip.sh " + + } + } } } @@ -59,15 +65,22 @@ checkout scm if (isCustomerChanged == true) { node{ - + dir('customer-service'){ stage('checkout') { - dir('customer-service'){ + sh "chmod +x script.sh" sh "./script.sh " - } } + stage('scrip') { + + + sh "chmod +x scrip.sh" + sh "./scrip.sh " + + } + } } From faeb8d8269c7f17efd219aaec16a79473ba98214 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:37:27 +0100 Subject: [PATCH 66/95] Update scrip.sh --- customer-service/scrip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/customer-service/scrip.sh b/customer-service/scrip.sh index d9ba90b6..7b9d8f57 100644 --- a/customer-service/scrip.sh +++ b/customer-service/scrip.sh @@ -1,3 +1,3 @@ #!/bin/sh -echo " yess yess account-service 2 " +echo " yess yess customer-service 2 " From 41aedb76b2f3c1a7d79c2c4a66afb614570ed421 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 15:43:37 +0100 Subject: [PATCH 67/95] Update Jenkinsfile --- Jenkinsfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 9665eaeb..de52aac8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,6 +53,18 @@ checkout scm sh "chmod +x scrip.sh" sh "./scrip.sh " + } + stage('checkout2') { + + sh "chmod +x script.sh" + sh "./script.sh " + + } + stage('scrip2') { + + sh "chmod +x scrip.sh" + sh "./scrip.sh " + } } } @@ -80,6 +92,21 @@ checkout scm sh "./scrip.sh " } + stage('checkout2') { + + + sh "chmod +x script.sh" + sh "./script.sh " + + } + stage('scrip2') { + + + sh "chmod +x scrip.sh" + sh "./scrip.sh " + + } + } } From 25683a8a4d62af3b9c51258689e18e0e9e34656a Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 16:09:39 +0100 Subject: [PATCH 68/95] Update Jenkinsfile --- Jenkinsfile | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index de52aac8..7baeb00b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,6 +32,32 @@ checkout scm } } } +def micro() { + stage('checkout') { + + sh "chmod +x script.sh" + sh "./script.sh " + + } + stage('scrip') { + + sh "chmod +x scrip.sh" + sh "./scrip.sh " + + } + stage('checkout2') { + + sh "chmod +x script.sh" + sh "./script.sh " + + } + stage('scrip2') { + + sh "chmod +x scrip.sh" + sh "./scrip.sh " + + } +} stage('Test') { @@ -42,7 +68,7 @@ checkout scm node{ dir('account-service'){ - stage('checkout') { + /* stage('checkout') { sh "chmod +x script.sh" sh "./script.sh " @@ -65,7 +91,8 @@ checkout scm sh "chmod +x scrip.sh" sh "./scrip.sh " - } + }*/ + micro() } } From c197ce9c008f05919962d96297a5a1a9d30a66dc Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 16:24:42 +0100 Subject: [PATCH 69/95] Update Jenkinsfile --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7baeb00b..68b59e46 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,25 +36,25 @@ def micro() { stage('checkout') { sh "chmod +x script.sh" - sh "./script.sh " + sh "pwd ; ./script.sh " } stage('scrip') { sh "chmod +x scrip.sh" - sh "./scrip.sh " + sh "pwd ; ./scrip.sh " } stage('checkout2') { sh "chmod +x script.sh" - sh "./script.sh " + sh "pwd ; ./script.sh " } stage('scrip2') { sh "chmod +x scrip.sh" - sh "./scrip.sh " + sh "pwd ; ./scrip.sh " } } From 4fabecda9d47d93830289c9ba821e384e133a716 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 16:30:05 +0100 Subject: [PATCH 70/95] Update Jenkinsfile --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 68b59e46..c2150476 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -105,7 +105,7 @@ def micro() { node{ dir('customer-service'){ - stage('checkout') { + /* stage('checkout') { sh "chmod +x script.sh" @@ -132,7 +132,8 @@ def micro() { sh "chmod +x scrip.sh" sh "./scrip.sh " - } + }*/ + micro() } From 5d7ba3dd14e524d38b9b198ae81cb2fddec40b94 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 16:39:01 +0100 Subject: [PATCH 71/95] Update Jenkinsfile --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c2150476..c21cf0c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,25 +35,25 @@ checkout scm def micro() { stage('checkout') { - sh "chmod +x script.sh" + sh "pwd ;chmod +x script.sh" sh "pwd ; ./script.sh " } stage('scrip') { - sh "chmod +x scrip.sh" + sh "pwd ;chmod +x scrip.sh" sh "pwd ; ./scrip.sh " } stage('checkout2') { - sh "chmod +x script.sh" + sh "pwd ; chmod +x script.sh" sh "pwd ; ./script.sh " } stage('scrip2') { - sh "chmod +x scrip.sh" + sh "pwd ; chmod +x scrip.sh" sh "pwd ; ./scrip.sh " } From 062844e3aba18683bf1746ee582f22a8954d6aba Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 16:54:55 +0100 Subject: [PATCH 72/95] Update Jenkinsfile --- Jenkinsfile | 58 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c21cf0c5..e23bdf28 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,28 +34,54 @@ checkout scm } def micro() { stage('checkout') { - + dir('account-service'){ sh "pwd ;chmod +x script.sh" sh "pwd ; ./script.sh " - + } } stage('scrip') { - + dir('account-service'){ sh "pwd ;chmod +x scrip.sh" sh "pwd ; ./scrip.sh " - + } } stage('checkout2') { - + dir('account-service'){ sh "pwd ; chmod +x script.sh" sh "pwd ; ./script.sh " - + } } stage('scrip2') { - + dir('account-service'){ sh "pwd ; chmod +x scrip.sh" sh "pwd ; ./scrip.sh " - + } + } +} +def micro1() { + stage('checkout') { + dir('customer-service'){ + sh "pwd ;chmod +x script.sh" + sh "pwd ; ./script.sh " + } + } + stage('scrip') { + dir('customer-service'){ + sh "pwd ;chmod +x scrip.sh" + sh "pwd ; ./scrip.sh " + } + } + stage('checkout2') { + dir('customer-service'){ + sh "pwd ; chmod +x script.sh" + sh "pwd ; ./script.sh " + } + } + stage('scrip2') { + dir('customer-service'){ + sh "pwd ; chmod +x scrip.sh" + sh "pwd ; ./scrip.sh " + } } } @@ -67,7 +93,7 @@ def micro() { if (isAccountChanged == true) { node{ - dir('account-service'){ + /* stage('checkout') { sh "chmod +x script.sh" @@ -91,9 +117,10 @@ def micro() { sh "chmod +x scrip.sh" sh "./scrip.sh " + } }*/ + micro() - } } } @@ -104,8 +131,8 @@ def micro() { if (isCustomerChanged == true) { node{ - dir('customer-service'){ - /* stage('checkout') { + /* dir('customer-service'){ + stage('checkout') { sh "chmod +x script.sh" @@ -132,10 +159,11 @@ def micro() { sh "chmod +x scrip.sh" sh "./scrip.sh " - }*/ - micro() + } + } */ + micro1() - } + } From d6fe7b92e64a9286220bde3ea386e2759d2781fc Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 17:09:23 +0100 Subject: [PATCH 73/95] Update Jenkinsfile --- Jenkinsfile | 107 +++++++--------------------------------------------- 1 file changed, 14 insertions(+), 93 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e23bdf28..c989662d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,54 +34,28 @@ checkout scm } def micro() { stage('checkout') { - dir('account-service'){ - sh "pwd ;chmod +x script.sh" - sh "pwd ; ./script.sh " - } - } - stage('scrip') { - dir('account-service'){ - sh "pwd ;chmod +x scrip.sh" - sh "pwd ; ./scrip.sh " - } - } - stage('checkout2') { - dir('account-service'){ - sh "pwd ; chmod +x script.sh" - sh "pwd ; ./script.sh " - } - } - stage('scrip2') { - dir('account-service'){ - sh "pwd ; chmod +x scrip.sh" - sh "pwd ; ./scrip.sh " - } - } -} -def micro1() { - stage('checkout') { - dir('customer-service'){ + sh "pwd ;chmod +x script.sh" sh "pwd ; ./script.sh " - } + } stage('scrip') { - dir('customer-service'){ + sh "pwd ;chmod +x scrip.sh" sh "pwd ; ./scrip.sh " - } + } stage('checkout2') { - dir('customer-service'){ + sh "pwd ; chmod +x script.sh" sh "pwd ; ./script.sh " - } + } stage('scrip2') { - dir('customer-service'){ + sh "pwd ; chmod +x scrip.sh" sh "pwd ; ./scrip.sh " - } + } } @@ -93,34 +67,9 @@ def micro1() { if (isAccountChanged == true) { node{ - - /* stage('checkout') { - - sh "chmod +x script.sh" - sh "./script.sh " - - } - stage('scrip') { - - sh "chmod +x scrip.sh" - sh "./scrip.sh " - - } - stage('checkout2') { - - sh "chmod +x script.sh" - sh "./script.sh " - - } - stage('scrip2') { - - sh "chmod +x scrip.sh" - sh "./scrip.sh " - - } - }*/ - + dir('account-service'){ micro() + } } } @@ -131,39 +80,11 @@ def micro1() { if (isCustomerChanged == true) { node{ - /* dir('customer-service'){ - stage('checkout') { - - - sh "chmod +x script.sh" - sh "./script.sh " - - } - stage('scrip') { - - - sh "chmod +x scrip.sh" - sh "./scrip.sh " - - } - stage('checkout2') { - - - sh "chmod +x script.sh" - sh "./script.sh " - - } - stage('scrip2') { - - - sh "chmod +x scrip.sh" - sh "./scrip.sh " - - } - } */ - micro1() - + dir('customer-service'){ + micro() + + } } From 0b054029218965d03282730ac3473c173560ced4 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 17:17:13 +0100 Subject: [PATCH 74/95] Update Jenkinsfile --- Jenkinsfile | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c989662d..37fa251b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -59,7 +59,7 @@ def micro() { } } - stage('Test') { +/* stage('Test') { parallel ( "account": { @@ -91,6 +91,34 @@ def micro() { } } - ) - } + )*/ + def tasks = [:] + + tasks["TasK No.1"] = { + if (isAccountChanged == true) { + + node{ + dir('account-service'){ + micro() + } + } + + } + } + tasks["task No.2"] = { + if (isAccountChanged == true) { + + node{ + dir('account-service'){ + micro() + } + } + + } + } + + + parallel tasks + + From 2568beab6d5de018a5a2c1d43ad7acc291b13448 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 17:21:31 +0100 Subject: [PATCH 75/95] Update Jenkinsfile --- Jenkinsfile | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 37fa251b..034f9ead 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -59,7 +59,7 @@ def micro() { } } -/* stage('Test') { + stage('Test') { parallel ( "account": { @@ -91,34 +91,7 @@ def micro() { } } - )*/ - def tasks = [:] - - tasks["TasK No.1"] = { - if (isAccountChanged == true) { - - node{ - dir('account-service'){ - micro() - } - } - - } - } - tasks["task No.2"] = { - if (isAccountChanged == true) { - - node{ - dir('account-service'){ - micro() - } - } - - } - } - - - parallel tasks - + ) + } From 9398386cbea39c566e8d8cf2ae19c282e1e29a24 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 17:49:16 +0100 Subject: [PATCH 76/95] Update Jenkinsfile --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 034f9ead..51edb0a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,9 +67,10 @@ def micro() { if (isAccountChanged == true) { node{ + ws("${env.JOB_NAME}") { dir('account-service'){ micro() - } + }} } } @@ -80,6 +81,7 @@ def micro() { if (isCustomerChanged == true) { node{ + ws("${env.JOB_NAME}") { dir('customer-service'){ micro() @@ -87,7 +89,7 @@ def micro() { } } - + } } } From 0d6da0dd6abdadd01a5cc2869f8620934c1d05a0 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 17:51:54 +0100 Subject: [PATCH 77/95] Update Jenkinsfile --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 51edb0a2..ca07594b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,10 +67,10 @@ def micro() { if (isAccountChanged == true) { node{ - ws("${env.JOB_NAME}") { + dir('account-service'){ micro() - }} + } } } @@ -81,7 +81,7 @@ def micro() { if (isCustomerChanged == true) { node{ - ws("${env.JOB_NAME}") { + dir('customer-service'){ micro() @@ -89,7 +89,7 @@ def micro() { } } - } + } } From 250e068091d63b76664a1b88f0c6971a225f3145 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Sun, 25 Feb 2018 17:54:37 +0100 Subject: [PATCH 78/95] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ca07594b..0ceaa20d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,7 +66,7 @@ def micro() { if (isAccountChanged == true) { - node{ + stages{ dir('account-service'){ micro() @@ -80,7 +80,7 @@ def micro() { if (isCustomerChanged == true) { - node{ + stages{ dir('customer-service'){ From 36de57337c1a5ad56c1bfe0503d487e7dcef792f Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Mon, 26 Feb 2018 09:52:47 +0100 Subject: [PATCH 79/95] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0ceaa20d..ca07594b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,7 +66,7 @@ def micro() { if (isAccountChanged == true) { - stages{ + node{ dir('account-service'){ micro() @@ -80,7 +80,7 @@ def micro() { if (isCustomerChanged == true) { - stages{ + node{ dir('customer-service'){ From 1251cd1e2b9b424d9cb15c0096ac0f5a3aa80ce0 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 28 Feb 2018 17:42:26 +0100 Subject: [PATCH 80/95] Update Jenkinsfile --- Jenkinsfile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ca07594b..b3050629 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,8 +61,7 @@ def micro() { stage('Test') { - parallel ( - "account": { + if (isAccountChanged == true) { @@ -75,8 +74,6 @@ def micro() { } - }, - "Customer": { if (isCustomerChanged == true) { @@ -92,8 +89,7 @@ def micro() { } - } - ) + } From bda0d8cac6e0f5f0328bac47c2548861b7fe1b50 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 28 Feb 2018 17:47:59 +0100 Subject: [PATCH 81/95] Update Jenkinsfile --- Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b3050629..bb9740fd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -60,9 +60,6 @@ def micro() { } stage('Test') { - - - if (isAccountChanged == true) { node{ @@ -74,7 +71,6 @@ def micro() { } - if (isCustomerChanged == true) { node{ From 8aab488e010ef978c3b3c8b8f3513f520e4c81bb Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 28 Feb 2018 17:52:45 +0100 Subject: [PATCH 82/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bb9740fd..8e04b467 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -48,7 +48,7 @@ def micro() { stage('checkout2') { sh "pwd ; chmod +x script.sh" - sh "pwd ; ./script.sh " + sh "./script.sh " } stage('scrip2') { From 95c19323c1b41455609cf4fb048cc7ecac4e700c Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Wed, 28 Feb 2018 17:57:16 +0100 Subject: [PATCH 83/95] Update Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8e04b467..01fd3646 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -85,7 +85,6 @@ def micro() { } - } From c1940177b5c9e3e41b525118f5e6cc70568e9512 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Thu, 26 Apr 2018 10:21:28 +0100 Subject: [PATCH 84/95] Update Jenkinsfile --- Jenkinsfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 01fd3646..392101bd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -86,5 +86,26 @@ def micro() { } } + + stage('deploy staging') { + + + def rancherCli = docker.image('rancher-server:5000/rburgst/rancher-cli-configured') + rancherCli.pull() + + rancherCli.inside { + try { + // remove the old rancher stack in case it exists, if not ignore all errors + sh 'cd docker && rancher rm demo-webshop-staging' + } catch (any) {} + } + rancherCli.inside { + // now deploy the new stack + sh 'cd docker && rancher up -s demo-webshop-staging -d' + } + + } + +} From 6334ec518c10be45297df2acd6b5fa7382647ec7 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Thu, 26 Apr 2018 11:28:19 +0100 Subject: [PATCH 85/95] Create docker-compose.yml --- docker-compose.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..ded47b59 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,27 @@ +version: 2 +services: + Goauth: + image: usman/go-auth:1.8 + command: + - "-l" + - "debug" + - "run" + - "--db-host" + - "db" + - "-p" + - "9000" + db: + image: mysql + environment: + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_DATABASE: messenger + MYSQL_USER: messenger + MYSQL_PASSWORD: messenger + + auth-lb: + image: rancher/lb-service-haproxy:v0.6.2 + ports: + - 9000:9000/tcp + labels: + io.rancher.container.agent.role: environmentAdmin + io.rancher.container.create_agent: 'true' From bc1b946e3c4da4057bec8f4b5914defce197a4f0 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Thu, 26 Apr 2018 11:33:03 +0100 Subject: [PATCH 86/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 392101bd..f4586d5d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -105,7 +105,7 @@ def micro() { } } - + } From 1c40a497853ffd91d046045669d8a542a9bc3486 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Thu, 26 Apr 2018 11:48:23 +0100 Subject: [PATCH 87/95] Update Jenkinsfile --- Jenkinsfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f4586d5d..90d5d063 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -86,25 +86,23 @@ def micro() { } } - +node { stage('deploy staging') { - - def rancherCli = docker.image('rancher-server:5000/rburgst/rancher-cli-configured') - rancherCli.pull() + - rancherCli.inside { - try { + // rancherCli.inside { + // try { // remove the old rancher stack in case it exists, if not ignore all errors - sh 'cd docker && rancher rm demo-webshop-staging' - } catch (any) {} - } - rancherCli.inside { + // sh 'cd docker && rancher rm demo-webshop-staging' + // } catch (any) {} + // } + // rancherCli.inside { // now deploy the new stack - sh 'cd docker && rancher up -s demo-webshop-staging -d' - } + sh 'rancher-compose --url http://192.168.56.101:8080 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h up' + // } - } + } } From b738e43f34b739224b9017e30d65f858a0ab01a1 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Thu, 26 Apr 2018 11:54:19 +0100 Subject: [PATCH 88/95] Create rancher-compose.yml --- rancher-compose.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 rancher-compose.yml diff --git a/rancher-compose.yml b/rancher-compose.yml new file mode 100644 index 00000000..df8c990f --- /dev/null +++ b/rancher-compose.yml @@ -0,0 +1,20 @@ +version: '2' +services: + Goauth: + scale: 2 + start_on_create: true + + auth-lb: + scale: 1 + start_on_create: true + lb_config: + port_rules: + - priority: 1 + protocol: http + service: Goauth + source_port: 9000 + target_port: 9000 + + db: + scale: 1 + start_on_create: true From c846d760859c5ab2782047dcc81e21239b337409 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Thu, 26 Apr 2018 11:54:44 +0100 Subject: [PATCH 89/95] Update rancher-compose.yml --- rancher-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/rancher-compose.yml b/rancher-compose.yml index df8c990f..84649d70 100644 --- a/rancher-compose.yml +++ b/rancher-compose.yml @@ -3,7 +3,6 @@ services: Goauth: scale: 2 start_on_create: true - auth-lb: scale: 1 start_on_create: true @@ -14,7 +13,6 @@ services: service: Goauth source_port: 9000 target_port: 9000 - db: scale: 1 start_on_create: true From 4cd7e34307af0e070081493fe71e84bde17f2878 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Thu, 26 Apr 2018 12:02:20 +0100 Subject: [PATCH 90/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 90d5d063..044399d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -99,7 +99,7 @@ node { // } // rancherCli.inside { // now deploy the new stack - sh 'rancher-compose --url http://192.168.56.101:8080 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h up' + sh 'rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h up' // } } From a1dba7c63418d54068666726e334b7bec73aaf1f Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Thu, 26 Apr 2018 12:02:36 +0100 Subject: [PATCH 91/95] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 044399d2..7f40c184 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,7 +103,7 @@ node { // } } - + } From 018a3938a8a9219bfdbf9ed0dfd2848962c1df56 Mon Sep 17 00:00:00 2001 From: ssaida Date: Thu, 26 Apr 2018 12:23:04 +0100 Subject: [PATCH 92/95] update --- docker-compose.yml => docker/docker-compose.yml | 0 rancher-compose.yml => docker/rancher-compose.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename docker-compose.yml => docker/docker-compose.yml (100%) rename rancher-compose.yml => docker/rancher-compose.yml (100%) diff --git a/docker-compose.yml b/docker/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to docker/docker-compose.yml diff --git a/rancher-compose.yml b/docker/rancher-compose.yml similarity index 100% rename from rancher-compose.yml rename to docker/rancher-compose.yml From 110963e33fb9dec9c79e6f6f898af0c0dded2e20 Mon Sep 17 00:00:00 2001 From: ssaida Date: Thu, 26 Apr 2018 12:49:14 +0100 Subject: [PATCH 93/95] update2 --- Jenkinsfile | 27 +++++++++----- docker/docker-compose.yml | 27 -------------- stack-master/docker-compose.yml | 39 ++++++++++++++++++++ {docker => stack-master}/rancher-compose.yml | 0 stack-trunk/docker-compose.yml | 39 ++++++++++++++++++++ stack-trunk/rancher-compose.yml | 18 +++++++++ 6 files changed, 113 insertions(+), 37 deletions(-) delete mode 100644 docker/docker-compose.yml create mode 100644 stack-master/docker-compose.yml rename {docker => stack-master}/rancher-compose.yml (100%) create mode 100644 stack-trunk/docker-compose.yml create mode 100644 stack-trunk/rancher-compose.yml diff --git a/Jenkinsfile b/Jenkinsfile index 7f40c184..803bfe85 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -88,21 +88,28 @@ def micro() { } node { stage('deploy staging') { + if (env.BRANCH_NAME == 'master'){ +try { + // remove the old rancher stack in case it exists, if not ignore all errors + sh 'cd stack-master && cd docker && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h rm' + } catch (any) {} + + // now deploy the new stack + sh 'cd stack-master && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h up -d' +} - - // rancherCli.inside { - // try { +else { + try { // remove the old rancher stack in case it exists, if not ignore all errors - // sh 'cd docker && rancher rm demo-webshop-staging' - // } catch (any) {} - // } - // rancherCli.inside { + sh 'cd stack-trunk && cd docker && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h rm' + } catch (any) {} + + // now deploy the new stack - sh 'rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h up' - // } - + sh 'cd stack-trunk && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h up -d' } +} } diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml deleted file mode 100644 index ded47b59..00000000 --- a/docker/docker-compose.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: 2 -services: - Goauth: - image: usman/go-auth:1.8 - command: - - "-l" - - "debug" - - "run" - - "--db-host" - - "db" - - "-p" - - "9000" - db: - image: mysql - environment: - MYSQL_ROOT_PASSWORD: rootpass - MYSQL_DATABASE: messenger - MYSQL_USER: messenger - MYSQL_PASSWORD: messenger - - auth-lb: - image: rancher/lb-service-haproxy:v0.6.2 - ports: - - 9000:9000/tcp - labels: - io.rancher.container.agent.role: environmentAdmin - io.rancher.container.create_agent: 'true' diff --git a/stack-master/docker-compose.yml b/stack-master/docker-compose.yml new file mode 100644 index 00000000..2474d936 --- /dev/null +++ b/stack-master/docker-compose.yml @@ -0,0 +1,39 @@ +version: 2 +services: + Goauth: + image: usman/go-auth:1.8 + command: + - "-l" + - "debug" + - "run" + - "--db-host" + - "db" + - "-p" + - "9000" + labels: + + io.rancher.scheduler.affinity:host_label: branch=master + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + db: + image: mysql + environment: + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_DATABASE: messenger + MYSQL_USER: messenger + MYSQL_PASSWORD: messenger + labels: + io.rancher.scheduler.affinity:host_label: branch=master + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + + auth-lb: + image: rancher/lb-service-haproxy:v0.6.2 + ports: + - 9000:9000/tcp + labels: + io.rancher.container.agent.role: environmentAdmin + io.rancher.container.create_agent: 'true' + io.rancher.scheduler.affinity:host_label: branch=master + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name diff --git a/docker/rancher-compose.yml b/stack-master/rancher-compose.yml similarity index 100% rename from docker/rancher-compose.yml rename to stack-master/rancher-compose.yml diff --git a/stack-trunk/docker-compose.yml b/stack-trunk/docker-compose.yml new file mode 100644 index 00000000..f2ce5f74 --- /dev/null +++ b/stack-trunk/docker-compose.yml @@ -0,0 +1,39 @@ +version: 2 +services: + Goauth: + image: usman/go-auth:1.8 + command: + - "-l" + - "debug" + - "run" + - "--db-host" + - "db" + - "-p" + - "9000" + labels: + + io.rancher.scheduler.affinity:host_label: branch=trunk + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + db: + image: mysql + environment: + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_DATABASE: messenger + MYSQL_USER: messenger + MYSQL_PASSWORD: messenger + labels: + io.rancher.scheduler.affinity:host_label: branch=trunk + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + + auth-lb: + image: rancher/lb-service-haproxy:v0.6.2 + ports: + - 9000:9000/tcp + labels: + io.rancher.container.agent.role: environmentAdmin + io.rancher.container.create_agent: 'true' + io.rancher.scheduler.affinity:host_label: branch=trunk + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name diff --git a/stack-trunk/rancher-compose.yml b/stack-trunk/rancher-compose.yml new file mode 100644 index 00000000..84649d70 --- /dev/null +++ b/stack-trunk/rancher-compose.yml @@ -0,0 +1,18 @@ +version: '2' +services: + Goauth: + scale: 2 + start_on_create: true + auth-lb: + scale: 1 + start_on_create: true + lb_config: + port_rules: + - priority: 1 + protocol: http + service: Goauth + source_port: 9000 + target_port: 9000 + db: + scale: 1 + start_on_create: true From 945a9e1dae8e2281c16a90a4a9ab98e2ae6a6bdb Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Thu, 26 Apr 2018 16:38:07 +0100 Subject: [PATCH 94/95] Update Jenkinsfile --- Jenkinsfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 803bfe85..53d879f8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -91,26 +91,31 @@ node { if (env.BRANCH_NAME == 'master'){ try { // remove the old rancher stack in case it exists, if not ignore all errors - sh 'cd stack-master && cd docker && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h rm' + sh 'cd stack-master && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd down' + sh 'cd stack-master && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd rm' + sleep(20) } catch (any) {} // now deploy the new stack - sh 'cd stack-master && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h up -d' + sh 'cd stack-master && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd up -d' } else { try { // remove the old rancher stack in case it exists, if not ignore all errors - sh 'cd stack-trunk && cd docker && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h rm' + sh 'cd stack-trunk && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd down' + sh 'cd stack-trunk && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd rm' + sleep(20) } catch (any) {} // now deploy the new stack - sh 'cd stack-trunk && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key 126F12D08951CE0554F2 --secret-key Ps1tpHbUmJ93LZ2avGQgrXGUJLgqqn86CMd3V56h up -d' + sh 'cd stack-trunk && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd up -d' } } } + From c2ac63fbe1ffb1e0ee1b60c5e944782bb847c843 Mon Sep 17 00:00:00 2001 From: saiida1 <35665538+saiida1@users.noreply.github.com> Date: Thu, 26 Apr 2018 16:39:26 +0100 Subject: [PATCH 95/95] Update Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 53d879f8..26fa3dc3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -96,7 +96,6 @@ try { sleep(20) } catch (any) {} - // now deploy the new stack sh 'cd stack-master && rancher-compose --url http://192.168.56.101:8080/v1/projects/1a5 --access-key B9D9EDC9AF35290AF178 --secret-key DRYbZZ96uM4mNTWWMooqrQVPXDcLm95sEGjMqBNd up -d' }