From 65edf7ff01fead65f1591bdf02ffd8dab9de34ec Mon Sep 17 00:00:00 2001 From: Sai-th Date: Wed, 21 May 2025 14:12:00 -0400 Subject: [PATCH 01/22] Update and rename helloworld.py to Branch_1.py --- Branch_1.py | 2 ++ helloworld.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 Branch_1.py delete mode 100644 helloworld.py diff --git a/Branch_1.py b/Branch_1.py new file mode 100644 index 00000000..b2bdcf33 --- /dev/null +++ b/Branch_1.py @@ -0,0 +1,2 @@ + +print("Multi branch Pipeline : Branch 1") diff --git a/helloworld.py b/helloworld.py deleted file mode 100644 index daa3c4af..00000000 --- a/helloworld.py +++ /dev/null @@ -1,2 +0,0 @@ - -print("Hello world") From 2120469532b137c9bb1d4964b691b0abc9a4c4cc Mon Sep 17 00:00:00 2001 From: Sai-th Date: Wed, 21 May 2025 14:14:45 -0400 Subject: [PATCH 02/22] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index da9c3aaa..396afb96 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ pipeline { sh ''' cd myapp python3 hello.py - python3 hello.py --name=Brad + python3 hello.py --name=Sai_Th ''' } } @@ -36,4 +36,4 @@ pipeline { } } } -} \ No newline at end of file +} From 7cc116c2b0a94e7389e261703412121af6ce1837 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Wed, 21 May 2025 14:15:08 -0400 Subject: [PATCH 03/22] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 396afb96..1ca60d30 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,8 +22,8 @@ pipeline { echo "Testing.." sh ''' cd myapp - python3 hello.py - python3 hello.py --name=Sai_Th + python3 Branch_1.py + python3 Branch_1.py --name=Sai_Th ''' } } From fae119b1a555dc6fc1a863c3c14e0c8368c74533 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Wed, 21 May 2025 14:26:02 -0400 Subject: [PATCH 04/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1ca60d30..48bda323 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ pipeline { sh ''' cd myapp python3 Branch_1.py - python3 Branch_1.py --name=Sai_Th + python3 Branch_1.py --name=Brad ''' } } From 39d77636c78c2cecf95b32eca9a8502971a05300 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Wed, 21 May 2025 14:29:32 -0400 Subject: [PATCH 05/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 48bda323..f5549378 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ pipeline { sh ''' cd myapp python3 Branch_1.py - python3 Branch_1.py --name=Brad + python3 Branch_1.py --name=Sai ''' } } From 822caf202982af7cdf57e22d31b5dec24befe623 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Thu, 22 May 2025 10:56:17 -0400 Subject: [PATCH 06/22] Update Jenkinsfile --- Jenkinsfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f5549378..eefc5198 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,10 @@ pipeline { - agent { - node { - label 'docker-agent-python' - } - } + // Branch_1 Jenkinsfile +agent { + node { + label 'docker-agent-python-branch1' // Unique label + } +} triggers { pollSCM '* * * * *' } From 64270b356eccaf291866f9d47aaf2d0bcf1179e1 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Thu, 22 May 2025 10:57:54 -0400 Subject: [PATCH 07/22] Update Jenkinsfile --- Jenkinsfile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index eefc5198..c7491472 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,17 +1,19 @@ pipeline { - // Branch_1 Jenkinsfile -agent { - node { - label 'docker-agent-python-branch1' // Unique label + agent { + node { + label 'docker-agent-python-branch1' // Unique label + } } -} triggers { - pollSCM '* * * * *' + pollSCM 'H/2 * * * *' // Less frequent polling + } + options { + disableConcurrentBuilds() // Prevent queue flooding } stages { stage('Build') { steps { - echo "Building.." + echo "Building Branch_1..." sh ''' cd myapp pip install -r requirements.txt @@ -20,7 +22,7 @@ agent { } stage('Test') { steps { - echo "Testing.." + echo "Testing Branch_1..." sh ''' cd myapp python3 Branch_1.py @@ -30,9 +32,9 @@ agent { } stage('Deliver') { steps { - echo 'Deliver....' + echo 'Delivering Branch_1...' sh ''' - echo "doing delivery stuff.." + echo "Branch_1 delivery logic..." ''' } } From d1dbecc4fe8703b12bda18009ac6fe85f5fce409 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Wed, 28 May 2025 21:42:25 -0400 Subject: [PATCH 08/22] Update Jenkinsfile --- Jenkinsfile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c7491472..fbb354e6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,30 +1,25 @@ pipeline { - agent { + agent { node { - label 'docker-agent-python-branch1' // Unique label + label 'jenkins_node_default' // Your Jenkins agent label } } triggers { - pollSCM 'H/2 * * * *' // Less frequent polling + pollSCM 'H/2 * * * *' // Polls Git every 2 minutes } options { - disableConcurrentBuilds() // Prevent queue flooding + disableConcurrentBuilds() // Prevent overlapping builds } stages { stage('Build') { steps { echo "Building Branch_1..." - sh ''' - cd myapp - pip install -r requirements.txt - ''' } } stage('Test') { steps { echo "Testing Branch_1..." sh ''' - cd myapp python3 Branch_1.py python3 Branch_1.py --name=Sai ''' From d62465ee00dff1a4202eb3076737ec83c8d0f6fb Mon Sep 17 00:00:00 2001 From: Sai-th Date: Wed, 28 May 2025 21:44:43 -0400 Subject: [PATCH 09/22] Update Jenkinsfile --- Jenkinsfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fbb354e6..e5965f4a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,11 @@ pipeline { agent { node { - label 'jenkins_node_default' // Your Jenkins agent label + label 'jenkins_node_default' } } triggers { - pollSCM 'H/2 * * * *' // Polls Git every 2 minutes + pollSCM 'H/2 * * * *' // Polls Git every 2 minutes for new build } options { disableConcurrentBuilds() // Prevent overlapping builds @@ -14,12 +14,17 @@ pipeline { stage('Build') { steps { echo "Building Branch_1..." + sh ''' + cd myapp + pip install -r requirements.txt + ''' } } stage('Test') { steps { echo "Testing Branch_1..." sh ''' + cd myapp python3 Branch_1.py python3 Branch_1.py --name=Sai ''' From 792321da4f1734a76bba18d6f0bfbfda7c3ceeec Mon Sep 17 00:00:00 2001 From: Sai-th Date: Wed, 28 May 2025 22:09:21 -0400 Subject: [PATCH 10/22] Update Jenkinsfile --- Jenkinsfile | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e5965f4a..3828cb0a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,21 +10,23 @@ pipeline { options { disableConcurrentBuilds() // Prevent overlapping builds } - stages { - stage('Build') { - steps { - echo "Building Branch_1..." - sh ''' - cd myapp - pip install -r requirements.txt - ''' + stage('Build') { + steps { + dir('myapp') { + sh ''' + python3 -m venv venv + source venv/bin/activate + pip install --upgrade pip + pip install -r requirements.txt''' } } + } stage('Test') { steps { - echo "Testing Branch_1..." + echo "Testing Master Branch..." sh ''' cd myapp + . venv/bin/activate python3 Branch_1.py python3 Branch_1.py --name=Sai ''' @@ -32,9 +34,9 @@ pipeline { } stage('Deliver') { steps { - echo 'Delivering Branch_1...' + echo 'Delivering Master Branch...' sh ''' - echo "Branch_1 delivery logic..." + echo "Master Branch delivery logic..." ''' } } From 341a69b77ca7b028cdabff9e907b01050341e509 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Wed, 28 May 2025 22:13:12 -0400 Subject: [PATCH 11/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3828cb0a..b98c47c1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { pip install -r requirements.txt''' } } - } + stage('Test') { steps { echo "Testing Master Branch..." From 6c4da30b3823f7480329a102eb587574d82a25fc Mon Sep 17 00:00:00 2001 From: Sai-th Date: Wed, 28 May 2025 23:21:32 -0400 Subject: [PATCH 12/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b98c47c1..5ff3eb09 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { pip install --upgrade pip pip install -r requirements.txt''' } - } + } } stage('Test') { steps { From a39d3c3e491649d22f3e5ce8612abd3b3bcc7131 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Thu, 29 May 2025 00:57:09 -0400 Subject: [PATCH 13/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5ff3eb09..e7ff6ed7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent { node { - label 'jenkins_node_default' + label 'docker-agent-alpine' } } triggers { From babda5871f82e0681ac8569305e2653d5113b1ee Mon Sep 17 00:00:00 2001 From: Sai-th Date: Thu, 29 May 2025 01:00:10 -0400 Subject: [PATCH 14/22] Update Jenkinsfile --- Jenkinsfile | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e7ff6ed7..50b19139 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,22 +5,24 @@ pipeline { } } triggers { - pollSCM 'H/2 * * * *' // Polls Git every 2 minutes for new build + pollSCM('H/2 * * * *') // Polls Git every 2 minutes for new build } options { disableConcurrentBuilds() // Prevent overlapping builds } - stage('Build') { - steps { - dir('myapp') { - sh ''' - python3 -m venv venv - source venv/bin/activate - pip install --upgrade pip - pip install -r requirements.txt''' + stages { // **Missing stages block** + stage('Build') { + steps { + dir('myapp') { + sh ''' + python3 -m venv venv + source venv/bin/activate + pip install --upgrade pip + pip install -r requirements.txt + ''' + } } - } } - + } stage('Test') { steps { echo "Testing Master Branch..." From 90c8e009b250ac0dd6887f76fa48e28c7a6cff2f Mon Sep 17 00:00:00 2001 From: Sai-th Date: Thu, 29 May 2025 01:00:44 -0400 Subject: [PATCH 15/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 50b19139..844cc209 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { options { disableConcurrentBuilds() // Prevent overlapping builds } - stages { // **Missing stages block** + stages { stage('Build') { steps { dir('myapp') { From 2cbe689fc5ae72becf48c606aae7ae7b7fa77767 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Thu, 29 May 2025 01:23:04 -0400 Subject: [PATCH 16/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 844cc209..daa55bfa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { dir('myapp') { sh ''' python3 -m venv venv - source venv/bin/activate + . venv/bin/activate pip install --upgrade pip pip install -r requirements.txt ''' From 0ddae1c1c868b1f30470c311fcb84d319440997d Mon Sep 17 00:00:00 2001 From: Sai-th Date: Thu, 29 May 2025 01:25:05 -0400 Subject: [PATCH 17/22] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index daa55bfa..1560d0d3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,8 +29,8 @@ pipeline { sh ''' cd myapp . venv/bin/activate - python3 Branch_1.py - python3 Branch_1.py --name=Sai + python3 hello.py + python3 hello.py --name=Sai ''' } } From 4d89901025a3fcfac11397af896ecb5ea70f663b Mon Sep 17 00:00:00 2001 From: Sai-th Date: Thu, 29 May 2025 10:08:47 -0400 Subject: [PATCH 18/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1560d0d3..1142e70d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { } } triggers { - pollSCM('H/2 * * * *') // Polls Git every 2 minutes for new build + pollSCM('H/10 * * * *') // Polls Git every 2 minutes for new build } options { disableConcurrentBuilds() // Prevent overlapping builds From 38eb3a7375615638b43b3257daae6f925e9f95ed Mon Sep 17 00:00:00 2001 From: Sai-th Date: Fri, 30 May 2025 08:12:49 -0400 Subject: [PATCH 19/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1142e70d..831ab9c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent { node { - label 'docker-agent-alpine' + label 'docker-agent-python' } } triggers { From 7ece52aa239c618638c7cbad6d84f6bdbe8967ca Mon Sep 17 00:00:00 2001 From: Sai-th Date: Fri, 30 May 2025 08:13:33 -0400 Subject: [PATCH 20/22] Update Jenkinsfile --- Jenkinsfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 831ab9c5..42beaf2f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,12 +5,22 @@ pipeline { } } triggers { - pollSCM('H/10 * * * *') // Polls Git every 2 minutes for new build + pollSCM('H/10 * * * *') // Polls Git every 10 minutes for new build } options { disableConcurrentBuilds() // Prevent overlapping builds } - stages { + stages { + stage('Prepare Python') { + steps { + sh ''' + apk update + apk add --no-cache python3 py3-pip python3-venv + python3 -m ensurepip + pip3 install --upgrade pip + ''' + } + } stage('Build') { steps { dir('myapp') { From d155e56a2ce05cc4640bc5e761befcd59e671326 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Fri, 30 May 2025 08:21:52 -0400 Subject: [PATCH 21/22] Update Jenkinsfile --- Jenkinsfile | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 42beaf2f..a755b8d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,22 +5,12 @@ pipeline { } } triggers { - pollSCM('H/10 * * * *') // Polls Git every 10 minutes for new build + pollSCM('H/10 * * * *') } options { - disableConcurrentBuilds() // Prevent overlapping builds + disableConcurrentBuilds() } - stages { - stage('Prepare Python') { - steps { - sh ''' - apk update - apk add --no-cache python3 py3-pip python3-venv - python3 -m ensurepip - pip3 install --upgrade pip - ''' - } - } + stages { stage('Build') { steps { dir('myapp') { @@ -47,9 +37,7 @@ pipeline { stage('Deliver') { steps { echo 'Delivering Master Branch...' - sh ''' - echo "Master Branch delivery logic..." - ''' + sh 'echo "Master Branch delivery logic..."' } } } From 56cf145976e9d419ce3000e393bd9d85e11b8ab0 Mon Sep 17 00:00:00 2001 From: Sai-th Date: Fri, 30 May 2025 09:57:49 -0400 Subject: [PATCH 22/22] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a755b8d0..236e6fe4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent { node { - label 'docker-agent-python' + label 'jenkins-agent-python' } } triggers {