From 910691648c2017c826da4cf3ab14272ec0a40ba0 Mon Sep 17 00:00:00 2001 From: amarama Date: Sat, 10 Feb 2018 13:28:32 -0800 Subject: [PATCH 01/51] added junit --- Jenkinsfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9bf770a7..bafe667d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,8 +4,9 @@ pipeline { stages { stage('Unit Tests') { steps { - sh 'ant -f test.xml -v' - junit 'reports/result.xml' + + sh 'ant -f text.xml -v' + } } stage('build') { @@ -19,5 +20,9 @@ pipeline { always { archiveArtifacts artifacts: 'dist/*.jar', fingerprint: true } + + steps{ + junit 'reports/result.xml' + } } } From e009e5d3546325b0927d14ffaf51f8bf462edd4f Mon Sep 17 00:00:00 2001 From: amarama Date: Sat, 10 Feb 2018 13:52:24 -0800 Subject: [PATCH 02/51] added junit --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bafe667d..9fdd8764 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,7 +21,7 @@ pipeline { archiveArtifacts artifacts: 'dist/*.jar', fingerprint: true } - steps{ + success{ junit 'reports/result.xml' } } From 90484466be25ecaf969635720f35f8c66c80390c Mon Sep 17 00:00:00 2001 From: amarama Date: Sat, 10 Feb 2018 13:54:07 -0800 Subject: [PATCH 03/51] added junit --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9fdd8764..06a7e9a5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { stage('Unit Tests') { steps { - sh 'ant -f text.xml -v' + sh 'ant -f test.xml -v' } } From e65f24226d9a8210860a1b6fabf28a8b39c6f81e Mon Sep 17 00:00:00 2001 From: amarama Date: Sat, 10 Feb 2018 14:10:34 -0800 Subject: [PATCH 04/51] updated gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7234e2c9..af52e969 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ bin/* dist/* reports/* docs/* +Jenkinsfile_01 From 6ecd48cd338404585e4bbf14f9815c0f00c1e88e Mon Sep 17 00:00:00 2001 From: amarama Date: Sat, 10 Feb 2018 14:19:53 -0800 Subject: [PATCH 05/51] gave the slave label --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9bf770a7..9e22fe23 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent any + agent centos stages { stage('Unit Tests') { From baba4d0cf353137d61b863f9b6d7fcf686169ab8 Mon Sep 17 00:00:00 2001 From: amarama Date: Sat, 10 Feb 2018 14:27:21 -0800 Subject: [PATCH 06/51] gave the slave label --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9e22fe23..6b6e4e7f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,7 @@ pipeline { - agent centos + agent { + label 'centos' + } stages { stage('Unit Tests') { From 8f0cec6c530e1d663f4771d6761d8c536f8180e0 Mon Sep 17 00:00:00 2001 From: amarama Date: Sat, 10 Feb 2018 14:50:11 -0800 Subject: [PATCH 07/51] gave the slave label --- Jenkinsfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 6b6e4e7f..a6e87f84 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,11 @@ pipeline { } stage('build') { steps { + + sh 'ant -f build.xml -v' + + } } } From 8d0929bf9297814c930a01354c51497b3814642a Mon Sep 17 00:00:00 2001 From: amarama Date: Mon, 12 Feb 2018 11:45:19 -0800 Subject: [PATCH 08/51] added lines to jenkinsfile to deploy to httpd --- Jenkinsfile | 12 ++++++++++-- build.xml | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a6e87f84..30cdba44 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ pipeline { agent { - label 'centos' + label 'master' } stages { @@ -13,12 +13,20 @@ pipeline { stage('build') { steps { - + sh 'ant -f build.xml -v' } } + + stage('deploy'){ + + steps{ + sh "cp dist/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangle/all/" + } + + } } post { diff --git a/build.xml b/build.xml index 8e7c08e7..062d7c5b 100644 --- a/build.xml +++ b/build.xml @@ -34,7 +34,7 @@ - + From 60366eea4bf02426deb354f932b1d3fbca0824f9 Mon Sep 17 00:00:00 2001 From: amarama Date: Mon, 12 Feb 2018 12:21:12 -0800 Subject: [PATCH 09/51] my fix --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 30cdba44..6b39288f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ pipeline { stage('deploy'){ steps{ - sh "cp dist/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangle/all/" + sh "cp dist/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/" } } From a19ecd54d06a53a4b4f56015ac9ce864e2f44d6a Mon Sep 17 00:00:00 2001 From: amarama Date: Mon, 12 Feb 2018 13:02:37 -0800 Subject: [PATCH 10/51] added the functionality testing to cetos and debeian docker --- Jenkinsfile | 62 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6b39288f..6f57e537 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,37 +1,81 @@ pipeline { - agent { - label 'master' - } + + agent none stages { stage('Unit Tests') { + + agent{ + label 'apache' + } steps { sh 'ant -f test.xml -v' junit 'reports/result.xml' } } stage('build') { - steps { + agent{ + label 'apache' + } + steps { sh 'ant -f build.xml -v' + } - + post { + success { + archiveArtifacts artifacts: 'dist/*.jar', fingerprint: true + } } + + } stage('deploy'){ + agent{ + label 'apache' + } + steps{ sh "cp dist/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/" } } - } - post { - always { - archiveArtifacts artifacts: 'dist/*.jar', fingerprint: true + + + + stage('functional check on docker debian'){ + + agent{ + docker 'openjdk:8u151-jre' + } + + steps{ + sh "wget http://srinuamar91.mylabserver.com/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar" + sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" + } + + stage('functional check on centos'){ + + agent{ + label 'centos' + } + + steps{ + sh "wget http://srinuamar91.mylabserver.com/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar" + sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" + } + + + + } + + } + + } From fb091f4f57954a2274cda0983b82de25ed339397 Mon Sep 17 00:00:00 2001 From: amarama Date: Mon, 12 Feb 2018 13:08:45 -0800 Subject: [PATCH 11/51] fixed jenkins file indentation --- Jenkinsfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6f57e537..cc2384d8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -58,24 +58,26 @@ pipeline { sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" } - stage('functional check on centos'){ - agent{ - label 'centos' - } + } - steps{ - sh "wget http://srinuamar91.mylabserver.com/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar" - sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" - } + stage('functional check on centos'){ + agent{ + label 'centos' + } - } + steps{ + sh "wget http://srinuamar91.mylabserver.com/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar" + sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" + } + } } + } From 8b961aa6408b37c2b7ae857d640c9061c1e0300a Mon Sep 17 00:00:00 2001 From: amarama Date: Wed, 14 Feb 2018 11:23:34 -0800 Subject: [PATCH 12/51] added cp to green folder --- Jenkinsfile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cc2384d8..9aede9b6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,8 +61,6 @@ pipeline { } - - stage('functional check on centos'){ agent{ @@ -75,6 +73,19 @@ pipeline { } } + stage('promote to green' ){ + + agent{ + label 'apache' + } + + steps{ + + sh "cp /var/www/html/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/green" + + } + } + } From ffabd9ac97db688558bf3bf3f78608c9448d372c Mon Sep 17 00:00:00 2001 From: amarama Date: Wed, 14 Feb 2018 11:29:03 -0800 Subject: [PATCH 13/51] fixed jenkins path to green folder --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9aede9b6..4766cb39 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -81,7 +81,7 @@ pipeline { steps{ - sh "cp /var/www/html/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/green" + sh "cp /var/www/html/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/green" } } From 3e0685865e2f5d3baf081ec845ca88beabd46d2f Mon Sep 17 00:00:00 2001 From: amarama Date: Wed, 14 Feb 2018 18:12:41 -0800 Subject: [PATCH 14/51] new google cloud trails --- Jenkinsfile | 18 ++-------- Jenkinsfile0 | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 16 deletions(-) create mode 100644 Jenkinsfile0 diff --git a/Jenkinsfile b/Jenkinsfile index 4766cb39..7a9f43ff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,24 +47,10 @@ pipeline { - stage('functional check on docker debian'){ - - agent{ - docker 'openjdk:8u151-jre' - } - - steps{ - sh "wget http://srinuamar91.mylabserver.com/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar" - sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" - } - - - } - - stage('functional check on centos'){ + stage('functional check on debian'){ agent{ - label 'centos' + label 'agentOne' } steps{ diff --git a/Jenkinsfile0 b/Jenkinsfile0 new file mode 100644 index 00000000..4766cb39 --- /dev/null +++ b/Jenkinsfile0 @@ -0,0 +1,94 @@ +pipeline { + + agent none + + stages { + stage('Unit Tests') { + + agent{ + label 'apache' + } + steps { + sh 'ant -f test.xml -v' + junit 'reports/result.xml' + } + } + stage('build') { + + agent{ + label 'apache' + } + + steps { + sh 'ant -f build.xml -v' + } + + post { + success { + archiveArtifacts artifacts: 'dist/*.jar', fingerprint: true + } + } + + + } + + stage('deploy'){ + + agent{ + label 'apache' + } + + steps{ + sh "cp dist/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/" + } + + } + + + + + stage('functional check on docker debian'){ + + agent{ + docker 'openjdk:8u151-jre' + } + + steps{ + sh "wget http://srinuamar91.mylabserver.com/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar" + sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" + } + + + } + + stage('functional check on centos'){ + + agent{ + label 'centos' + } + + steps{ + sh "wget http://srinuamar91.mylabserver.com/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar" + sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" + } + } + + stage('promote to green' ){ + + agent{ + label 'apache' + } + + steps{ + + sh "cp /var/www/html/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/green" + + } + } + + + } + + + +} From 40afa0ab614e476312f03419641620c3a213991f Mon Sep 17 00:00:00 2001 From: amarama Date: Wed, 14 Feb 2018 18:26:29 -0800 Subject: [PATCH 15/51] new 2 Goodle 2 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7a9f43ff..f7d1996d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -54,7 +54,7 @@ pipeline { } steps{ - sh "wget http://srinuamar91.mylabserver.com/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar" + sh "wget http://35.230.114.105/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar" sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" } } From b42f37eece6ad2c81071bc5d3c6793e0b806a8bf Mon Sep 17 00:00:00 2001 From: amarama Date: Wed, 14 Feb 2018 18:30:25 -0800 Subject: [PATCH 16/51] new 2 Goodle 4 --- Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f7d1996d..0dfeed07 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,8 +45,6 @@ pipeline { } - - stage('functional check on debian'){ agent{ From c3dca9c4f5d8bb803a658929e4a9dcc69f48f491 Mon Sep 17 00:00:00 2001 From: amarama Date: Wed, 14 Feb 2018 20:41:52 -0800 Subject: [PATCH 17/51] new 2 Goodle 5 --- Jenkinsfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 0dfeed07..9a341913 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -63,6 +63,10 @@ pipeline { label 'apache' } + when{ + branch 'Amar03' + } + steps{ sh "cp /var/www/html/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/green" From 815c9563e410eec0ad225306f512a7b4225ac882 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 06:56:50 -0800 Subject: [PATCH 18/51] trigger scm --- Jenkinsfile | 1 + Jenkinsfile_01 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Jenkinsfile_01 diff --git a/Jenkinsfile b/Jenkinsfile index 9bf770a7..8b7d8954 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,6 @@ pipeline { agent any + stages { stage('Unit Tests') { diff --git a/Jenkinsfile_01 b/Jenkinsfile_01 new file mode 100644 index 00000000..f6c3142a --- /dev/null +++ b/Jenkinsfile_01 @@ -0,0 +1,50 @@ +pipeline{ + agent none + + environment{ + + ENV_VAR='some_value' + + } + + stages{ + stage('build'){ + agent{ + label 'centos' + } + steps{ + echo 'building..' + } + stage('test'){ + agent docker + agent{ + docker 'openjdk:8u121-jre' + } + + steps{ + echo 'testing...' + } + } + + + + + + stage('deploy'){ + steps{ + echo 'deploying...' + } + } + } + + + post{ + + always{ + + archive 'dist/*.jar' + } + + } + +} From d8e4ed90240190a2415fa8f79b07e15639f8479e Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 07:03:10 -0800 Subject: [PATCH 19/51] this is a trigger2 --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0f37e4e8..30d7f890 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,12 +1,13 @@ pipeline { agent any - + stages { stage('Unit Tests') { steps { sh 'ant -f test.xml -v' + } } From 566b7fdedd8f480613fe298ff89d52130c7899c0 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 08:32:47 -0800 Subject: [PATCH 20/51] trigger scm --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 9a341913..72bc1621 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,6 +17,7 @@ pipeline { agent{ label 'apache' + } steps { From 756816fc2dc2ebc298f1f05e8773fd7009699533 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 08:38:26 -0800 Subject: [PATCH 21/51] trigger multibranch --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 72bc1621..e2c21345 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,8 +16,9 @@ pipeline { stage('build') { agent{ - label 'apache' + label 'apache' + } steps { From 715014888616871435ef5bc980e1075e74a9765a Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 08:42:39 -0800 Subject: [PATCH 22/51] this thing sucks --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e2c21345..408a2feb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { stage('build') { agent{ - + label 'apache' } @@ -27,7 +27,9 @@ pipeline { post { success { + archiveArtifacts artifacts: 'dist/*.jar', fingerprint: true + } } From 36fb398cc614dcbb3d347701405faad460572a84 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 08:44:58 -0800 Subject: [PATCH 23/51] this thing sucks 3 --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 408a2feb..7676c393 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,8 +8,10 @@ pipeline { agent{ label 'apache' } + steps { sh 'ant -f test.xml -v' + // junit 'reports/result.xml' } } @@ -29,7 +31,7 @@ pipeline { success { archiveArtifacts artifacts: 'dist/*.jar', fingerprint: true - + } } From 4987a10647b765940f9e1a390979981a369182f4 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 09:18:40 -0800 Subject: [PATCH 24/51] this is it --- Jenkinsfile | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7676c393..e6838fa2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,7 +70,7 @@ pipeline { } when{ - branch 'Amar03' + branch 'Amar02' } steps{ @@ -81,6 +81,33 @@ pipeline { } + stage('Promote Amar03 to Amar02'){ + + agent{ + label 'apache' + } + + when { + branch 'Amar03' + } + + steps{ + echo "Stashing any local changes.." + sh "git stash" + echo "Checking Out Amar03" + sh "git checkout Amar03" + echo "Checking Out Amar02" + sh "git checkout Amar02" + echo "Merging Amar03" + sh "git merge Amar03" + echo "Pushing to Origin Amar02" + sh 'git push origin Amar02' + + } + + } + + } From a21689a176e78275fc50c7df12bb3e0d47148c58 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 09:31:56 -0800 Subject: [PATCH 25/51] trigger the pipeline --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index e6838fa2..e91b9133 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -80,6 +80,7 @@ pipeline { } } + // Added this stage for automatic branch promotions ... stage('Promote Amar03 to Amar02'){ From c6e33907c7fb94d35606d0f69dd514d5c339997b Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 09:44:06 -0800 Subject: [PATCH 26/51] added an empty file --- sample | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sample diff --git a/sample b/sample new file mode 100644 index 00000000..e69de29b From fdfdcfde071597be4cb026d889cbacc4f2d7a15d Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 11:20:08 -0800 Subject: [PATCH 27/51] one more time --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index e91b9133..63b76680 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,6 +103,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' + ech0 'NO PROBLEMS' } From 07cf910c4840412f17430258b80e71dcb91274fe Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 11:21:40 -0800 Subject: [PATCH 28/51] one more time 1 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 63b76680..cb6e99f6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,7 +103,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - ech0 'NO PROBLEMS' + echo 'NO PROBLEMS' } From 811761971fa22b0ba4334860aeb1b07d4ee39bf4 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 11:23:40 -0800 Subject: [PATCH 29/51] np 12 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cb6e99f6..445033e9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,7 +103,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - echo 'NO PROBLEMS' + echo 'NO PROBLEMS 12' } From c286f702aa1e07102ae36a79215945b1594549af Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 11:27:12 -0800 Subject: [PATCH 30/51] np 13 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 445033e9..224289e5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,7 +103,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - echo 'NO PROBLEMS 12' + echo 'NO PROBLEMS 13' } From efc9ea04ecd6196533438b421d08fab8e03fa320 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 11:31:28 -0800 Subject: [PATCH 31/51] 14 --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 224289e5..83661910 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -97,6 +97,7 @@ pipeline { sh "git stash" echo "Checking Out Amar03" sh "git checkout Amar03" + git 'pull' echo "Checking Out Amar02" sh "git checkout Amar02" echo "Merging Amar03" From 6d2064d726aceabd02da39e5ce5858671aa9e9b9 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 11:34:24 -0800 Subject: [PATCH 32/51] 15 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 83661910..488b36f4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -97,7 +97,7 @@ pipeline { sh "git stash" echo "Checking Out Amar03" sh "git checkout Amar03" - git 'pull' + sh "git pull" echo "Checking Out Amar02" sh "git checkout Amar02" echo "Merging Amar03" From 16d73e1fe687b8bc30e958fa5704019fe8b5f9bf Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 11:51:06 -0800 Subject: [PATCH 33/51] 16 --- Jenkinsfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 488b36f4..7bff1ff6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,8 @@ pipeline { } steps{ - sh "cp dist/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/" + sh "mkdir -p /var/www/html/rectangles/all/${env.BRANCH_NAME}" + sh "cp dist/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/${env.BRANCH_NAME}" } } @@ -58,7 +59,7 @@ pipeline { } steps{ - sh "wget http://35.230.114.105/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar" + sh "wget http://35.230.114.105/rectangles/all/${env.BRANCH_NAME}/rectangle_${env.BUILD_NUMBER}.jar" sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" } } @@ -75,7 +76,7 @@ pipeline { steps{ - sh "cp /var/www/html/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/green" + sh "cp /var/www/html/rectangles/all/${env.BRANCH_NAME}/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/green" } } From 03cfa96b2d29c4a7c69e88f56aff00f1d8c48588 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 13:08:53 -0800 Subject: [PATCH 34/51] 15 --- Jenkinsfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7bff1ff6..76223e5a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,12 @@ pipeline { agent none + environment{ + + MAJOR_VERSION=1 + + } + stages { stage('Unit Tests') { @@ -106,7 +112,8 @@ pipeline { echo "Pushing to Origin Amar02" sh 'git push origin Amar02' echo 'NO PROBLEMS 13' - + sh 'git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}' + sh 'git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}' } } From 253699242f4a319fc3f4b19b3c47db5eeb4dc05e Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 13:16:57 -0800 Subject: [PATCH 35/51] 16 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0b523830..b2d69a39 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -116,7 +116,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - echo 'NO PROBLEMS 13' + echo 'NO PROBLEMS 16' sh 'git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}' sh 'git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}' } From 8b0a33e09b3f30c859b693119f0f1db07de79728 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 13:22:23 -0800 Subject: [PATCH 36/51] 17 --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b2d69a39..decbecb8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -116,9 +116,9 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - echo 'NO PROBLEMS 16' - sh 'git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}' - sh 'git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}' + echo 'NO PROBLEMS 17' + sh "git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}" + sh "git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}" } } From 17617a95a9118415beed73facdd95cca06874187 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 13:25:34 -0800 Subject: [PATCH 37/51] 18 --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index decbecb8..f1247aae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -57,7 +57,7 @@ pipeline { steps{ sh "mkdir -p /var/www/html/rectangles/all/${env.BRANCH_NAME}" - sh "cp dist/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/${env.BRANCH_NAME}" + sh "cp dist/rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/${env.BRANCH_NAME}" } } @@ -70,8 +70,8 @@ pipeline { } steps{ - sh "wget http://35.230.114.105/rectangles/all/${env.BRANCH_NAME}/rectangle_${env.BUILD_NUMBER}.jar" - sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321" + sh "wget http://35.230.114.105/rectangles/all/${env.BRANCH_NAME}/rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar" + sh "java -jar rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar 54 321" } } @@ -87,7 +87,7 @@ pipeline { steps{ - sh "cp /var/www/html/rectangles/all/${env.BRANCH_NAME}/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/green" + sh "cp /var/www/html/rectangles/all/${env.BRANCH_NAME}/rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar /var/www/html/rectangles/green" } } @@ -116,7 +116,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - echo 'NO PROBLEMS 17' + echo 'NO PROBLEMS 18' sh "git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}" sh "git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}" } From 73377ee239648b72b93c92daccf46208aaf257f1 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 13:27:57 -0800 Subject: [PATCH 38/51] 19 --- build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.xml b/build.xml index 062d7c5b..8576eabf 100644 --- a/build.xml +++ b/build.xml @@ -34,7 +34,7 @@ - + From 39f928c1ef14abc03671c3f06b7dc5905fd55930 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 14:56:18 -0800 Subject: [PATCH 39/51] added email notifications --- Jenkinsfile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f1247aae..6d5c1cec 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -93,7 +93,6 @@ pipeline { } // Added this stage for automatic branch promotions ... - stage('Promote Amar03 to Amar02'){ agent{ @@ -121,6 +120,24 @@ pipeline { sh "git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}" } + post{ + success{ + emailext(subject:"SUCCESSFUL Amar03 Promoted to Amar02 : Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",to:"srinuamar9@gmail.com") + } + } + + } + + + } + + + post{ + + always{ + + emailext(to:"srinuamar9@gmail.com") + } From b21608d498bd56fa4ea5d04d61fec0bd135650f7 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 15:06:46 -0800 Subject: [PATCH 40/51] added email code 2 --- Jenkinsfile | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6d5c1cec..0f9dbcf3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -122,8 +122,21 @@ pipeline { post{ success{ - emailext(subject:"SUCCESSFUL Amar03 Promoted to Amar02 : Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",to:"srinuamar9@gmail.com") + emailext(subject:"SUCCESSFUL Amar03 Promoted to Amar02 : Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", + body: """

SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':

+

Check console output at "${env.JOB_NAME} [${env.BUILD_NUMBER}]"

""", + + to:"srinuamar9@gmail.com") + } + + failure{ + emailext (subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", + body: """

FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':

+

Check console output at "${env.JOB_NAME} [${env.BUILD_NUMBER}]"

""", + to:"srinuamar9@gmail.com") } + + } } @@ -136,7 +149,14 @@ pipeline { always{ - emailext(to:"srinuamar9@gmail.com") + emailext( + + subject:"ENTER THE PROJECT ${env.JOB_NAME} BUILD ${env.BUILD_NUMBER}" + body: "FIND THE LOG HERE ${env.BUILD_URL}" + to:"srinuamar9@gmail.com" + + + ) } From 43c6d2e4fbb7ca829f1358eb249d75dbc15336d6 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 15:08:06 -0800 Subject: [PATCH 41/51] added email code 3 --- Jenkinsfile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0f9dbcf3..1ac28257 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -149,14 +149,9 @@ pipeline { always{ - emailext( - - subject:"ENTER THE PROJECT ${env.JOB_NAME} BUILD ${env.BUILD_NUMBER}" - body: "FIND THE LOG HERE ${env.BUILD_URL}" - to:"srinuamar9@gmail.com" - - - ) + emailext(subject:"ENTER THE PROJECT ${env.JOB_NAME} BUILD ${env.BUILD_NUMBER}", + body: "FIND THE LOG HERE ${env.BUILD_URL}", + to:"srinuamar9@gmail.com") } From 2b8d0035cab26b1bd929a679d309de579518fc2d Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 15:19:15 -0800 Subject: [PATCH 42/51] added email code 4 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1ac28257..ce5a601b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -115,7 +115,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - echo 'NO PROBLEMS 18' + echo 'NO PROBLEMS 19' sh "git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}" sh "git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}" } From 8b189f64dab259f47f83a056bc5a5342feb628b3 Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 15:21:32 -0800 Subject: [PATCH 43/51] added email code 5 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ce5a601b..c4ca007f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -115,7 +115,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - echo 'NO PROBLEMS 19' + echo 'NO PROBLEMS 20' sh "git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}" sh "git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}" } From c58bab0b04b00b1d5ed4c784573d6d01342b824d Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 15:27:10 -0800 Subject: [PATCH 44/51] added email code 6 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c4ca007f..61e6eb55 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -115,7 +115,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - echo 'NO PROBLEMS 20' + echo 'NO PROBLEMS 21' sh "git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}" sh "git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}" } From b9135b738ceb76cdd80699e7f9c3d7a5cae9e8bd Mon Sep 17 00:00:00 2001 From: amarama Date: Thu, 15 Feb 2018 15:32:54 -0800 Subject: [PATCH 45/51] added email code 7 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 61e6eb55..bae38c9b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -115,7 +115,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - echo 'NO PROBLEMS 21' + echo 'NO PROBLEMS 22' sh "git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}" sh "git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}" } From fe7790849f45b81114044e62f2d7f84fe246e17a Mon Sep 17 00:00:00 2001 From: amarama Date: Fri, 16 Feb 2018 06:48:15 -0800 Subject: [PATCH 46/51] added lines to test pipeline library --- Jenkinsfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index bae38c9b..a24d2062 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,6 +92,19 @@ pipeline { } } + stage{ + + agent any + + steps{ + + SayHello 'Lingineni' + + } + } + + } + } // Added this stage for automatic branch promotions ... stage('Promote Amar03 to Amar02'){ @@ -99,6 +112,8 @@ pipeline { label 'apache' } + + when { branch 'Amar03' } From b2e318bd6d2f3d0f31dbeed421ae2ace42fc67ab Mon Sep 17 00:00:00 2001 From: amarama Date: Fri, 16 Feb 2018 06:55:42 -0800 Subject: [PATCH 47/51] 23 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a24d2062..0edb32cd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -130,7 +130,7 @@ pipeline { sh "git merge Amar03" echo "Pushing to Origin Amar02" sh 'git push origin Amar02' - echo 'NO PROBLEMS 22' + echo 'NO PROBLEMS 23' sh "git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}" sh "git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}" } From 4ddfd937e1622a6f5c2b228f00cd8aa4d5e324a1 Mon Sep 17 00:00:00 2001 From: amarama Date: Fri, 16 Feb 2018 06:59:27 -0800 Subject: [PATCH 48/51] added stage name --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0edb32cd..d98bdae5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,7 +92,7 @@ pipeline { } } - stage{ + stage('GREETINGS'){ agent any From e50ce37887fa1d647d280980ea2506fe465c9b0c Mon Sep 17 00:00:00 2001 From: amarama Date: Fri, 16 Feb 2018 07:02:33 -0800 Subject: [PATCH 49/51] removed arg on SayHello call --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d98bdae5..cb2f32ff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -98,7 +98,7 @@ pipeline { steps{ - SayHello 'Lingineni' + SayHello } } From 61281849766f62ea4bc40ae218d1a5919edc1bba Mon Sep 17 00:00:00 2001 From: amarama Date: Fri, 16 Feb 2018 07:04:33 -0800 Subject: [PATCH 50/51] fixed unexpected token issues --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cb2f32ff..d0179a3a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -98,13 +98,13 @@ pipeline { steps{ - SayHello + SayHello 'Lingineni' } - } + } - } + // Added this stage for automatic branch promotions ... stage('Promote Amar03 to Amar02'){ From d52122281f0f21f08e6f1301833cd95ce87031f4 Mon Sep 17 00:00:00 2001 From: amarama Date: Fri, 16 Feb 2018 07:08:34 -0800 Subject: [PATCH 51/51] undid it --- Jenkinsfile | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d0179a3a..c0e5850b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { steps { - + sh 'ant -f test.xml -v' // junit 'reports/result.xml' @@ -92,18 +92,7 @@ pipeline { } } - stage('GREETINGS'){ - - agent any - - steps{ - - SayHello 'Lingineni' - } - - - } // Added this stage for automatic branch promotions ... stage('Promote Amar03 to Amar02'){