From 83ec55328c10ad74b3b30d18d35be2a1562c05b0 Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:58:44 +0530 Subject: [PATCH 01/12] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 38a78cde..551c322e 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ This is a Sample Maven App. +Changes for polling From a9a097fac11578a5d72c1f3cac56a51269004474 Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:02:00 +0530 Subject: [PATCH 02/12] Create Jenkinsfile --- Jenkinsfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..8f3ddbb4 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,32 @@ +pipeline { + agent any + tools { + maven 'Maven 3.6.3' + } + stages{ + stage("build"){ + steps{ + echo 'Compiling the code for sysfoo' + sh 'mvn compile' + } + } + stage("Test"){ + steps{ + echo 'Clean test with unit test for sysfoo' + sh 'mvn clean test' + } + } + stage("Package"){ + steps{ + echo 'Generating artifacts for deployment' + sh 'mvn package -DskipTests' + } + } + } + + post{ + always{ + echo 'This pipeline is completed..' + } + } +} From ad9c83fbc8e48547c14f751b61041cd591573bab Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:29:31 +0530 Subject: [PATCH 03/12] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8f3ddbb4..6cce5488 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { stages{ stage("build"){ steps{ - echo 'Compiling the code for sysfoo' + echo 'Compiling the code for sysfoo app' sh 'mvn compile' } } From 586bd13c4c00c8279b23afcca68b1058771c2d1c Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:24:50 +0530 Subject: [PATCH 04/12] Added Jenkinsfile --- Jenkinsfile | 66 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6cce5488..cb7ae2a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,32 +1,52 @@ pipeline { agent any - tools { - maven 'Maven 3.6.3' - } - stages{ - stage("build"){ - steps{ - echo 'Compiling the code for sysfoo app' - sh 'mvn compile' - } + stages { + stage('build') { + steps { + echo 'Compiling the code for sysfoo app' + sh 'mvn compile' } - stage("Test"){ - steps{ - echo 'Clean test with unit test for sysfoo' - sh 'mvn clean test' - } + } + + stage('Test') { + steps { + echo 'Clean test with unit test for sysfoo' + sh 'mvn clean test' } - stage("Package"){ - steps{ - echo 'Generating artifacts for deployment' - sh 'mvn package -DskipTests' + } + + stage('Package') { + parallel { + stage('Package') { + steps { + echo 'Generating artifacts for deployment' + sh 'mvn package -DskipTests' + } + } + + stage('TestA') { + steps { + sleep(time: 5, unit: 'SECONDS') } + } + } - } + } - post{ - always{ - echo 'This pipeline is completed..' + stage('TestB') { + steps { + sleep 3 + } } + + } + tools { + maven 'Maven 3.6.3' + } + post { + always { + echo 'This pipeline is completed..' + } + } -} +} \ No newline at end of file From baa344e9ae60ebc0de0c754c59f29f122bb48c3e Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:52:22 +0530 Subject: [PATCH 05/12] Update Jenkinsfile --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cb7ae2a2..38712440 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,11 +17,14 @@ pipeline { stage('Package') { parallel { - stage('Package') { + when { + branch 'master' + stage('Package') { steps { echo 'Generating artifacts for deployment' sh 'mvn package -DskipTests' } + } } stage('TestA') { @@ -49,4 +52,4 @@ pipeline { } } -} \ No newline at end of file +} From 8da5056621898ca36c94375d185046dc7ec04a04 Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:56:59 +0530 Subject: [PATCH 06/12] Updated when conditions --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 38712440..e1878b3a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,13 +19,14 @@ pipeline { parallel { when { branch 'master' + } stage('Package') { steps { echo 'Generating artifacts for deployment' sh 'mvn package -DskipTests' } } - } + stage('TestA') { steps { From e40112c6416bea5dc1494d7136d8b36ba54bf471 Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:02:19 +0530 Subject: [PATCH 07/12] Updated package conditional run-1 --- Jenkinsfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e1878b3a..7391f2c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,14 +17,15 @@ pipeline { stage('Package') { parallel { - when { - branch 'master' - } stage('Package') { - steps { - echo 'Generating artifacts for deployment' - sh 'mvn package -DskipTests' - } + when{ + branch 'master' + } + steps { + echo 'Generating artifacts for deployment' + sh 'mvn package -DskipTests' + } + } From b87f1a09744c7b873073d8334529d4453840c3c5 Mon Sep 17 00:00:00 2001 From: Nandini Jha Date: Tue, 16 Apr 2024 14:22:24 +0530 Subject: [PATCH 08/12] Changes to feature --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 551c322e..098b6ee6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ This is a Sample Maven App. -Changes for polling +Trying to push with branch rules From bb92a8763ccc7f77830392efeaeb22502ecd9340 Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:21:50 +0530 Subject: [PATCH 09/12] Added docker as agent --- Jenkinsfile | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7391f2c9..cdd63164 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,10 @@ pipeline { - agent any + agent { + docker { + image 'maven:3.6.3-jdk-11-slim' + } + + } stages { stage('build') { steps { @@ -17,17 +22,15 @@ pipeline { stage('Package') { parallel { - stage('Package') { - when{ - branch 'master' - } - steps { - echo 'Generating artifacts for deployment' - sh 'mvn package -DskipTests' - } - + stage('Package') { + when { + branch 'master' } - + steps { + echo 'Generating artifacts for deployment' + sh 'mvn package -DskipTests' + } + } stage('TestA') { steps { @@ -54,4 +57,4 @@ pipeline { } } -} +} \ No newline at end of file From 00d36642df65c87b2dee86acd3a70d16917985ff Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:27:15 +0530 Subject: [PATCH 10/12] Added Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index cdd63164..5e9c61ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,7 @@ pipeline { agent { docker { image 'maven:3.6.3-jdk-11-slim' + args 'Updated docker as a agent' } } From 8f501a1fc8676e9ae4c6e75a92ecfd361b64e340 Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:38:23 +0530 Subject: [PATCH 11/12] Update Jenkinsfile Removed global tool config --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5e9c61ae..0d60949d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,13 +49,11 @@ pipeline { } } - tools { - maven 'Maven 3.6.3' - } + post { always { echo 'This pipeline is completed..' } } -} \ No newline at end of file +} From 82341a4327b63b1bd3e38600a893ed12412dcf61 Mon Sep 17 00:00:00 2001 From: Nandini Jha <37576336+NandiniJha1@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:01:27 +0530 Subject: [PATCH 12/12] Added Jenkinsfile --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0d60949d..16f0de56 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,6 @@ pipeline { agent { docker { image 'maven:3.6.3-jdk-11-slim' - args 'Updated docker as a agent' } } @@ -49,11 +48,10 @@ pipeline { } } - post { always { echo 'This pipeline is completed..' } } -} +} \ No newline at end of file