From b2eea4fd325fa6361ff9d9da312596561c23d6ab Mon Sep 17 00:00:00 2001 From: zhouxinyang Date: Tue, 23 Jan 2024 17:09:09 +0400 Subject: [PATCH 01/10] add one line for build --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index da9c3aaa..78737320 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent { node { - label 'docker-agent-python' + label 'docker-agent-alpine-python' } } triggers { @@ -14,6 +14,7 @@ pipeline { sh ''' cd myapp pip install -r requirements.txt + echo "install the requirements.txt" ''' } } From bc5ecbd96360389a8a1fe661ab1f0f3c994c5f0c Mon Sep 17 00:00:00 2001 From: zhouxinyang Date: Tue, 23 Jan 2024 19:39:56 +0400 Subject: [PATCH 02/10] use venv --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 78737320..7925aadd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,8 @@ pipeline { echo "Building.." sh ''' cd myapp + python3 -m venv .venv + source .venv/bin/activate pip install -r requirements.txt echo "install the requirements.txt" ''' From c6e3931e85f5a26eab3c345b4095cdf9c1146bed Mon Sep 17 00:00:00 2001 From: zhouxinyang Date: Tue, 23 Jan 2024 19:45:10 +0400 Subject: [PATCH 03/10] use pip3 install requirements --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7925aadd..8f2957b3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { cd myapp python3 -m venv .venv source .venv/bin/activate - pip install -r requirements.txt + pip3 install -r requirements.txt echo "install the requirements.txt" ''' } From 709bcf569d0552ad5598fd331c512f50cf701540 Mon Sep 17 00:00:00 2001 From: zhouxinyang Date: Tue, 23 Jan 2024 19:59:03 +0400 Subject: [PATCH 04/10] modify activate path --- Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8f2957b3..f4c64dc5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,9 +14,8 @@ pipeline { sh ''' cd myapp python3 -m venv .venv - source .venv/bin/activate + source ~/.venv/bin/activate pip3 install -r requirements.txt - echo "install the requirements.txt" ''' } } From 233d77a79c3577f40c4261dd0e27e0e425cb0bbe Mon Sep 17 00:00:00 2001 From: zhouxinyang Date: Tue, 23 Jan 2024 20:09:40 +0400 Subject: [PATCH 05/10] modify activate path --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f4c64dc5..a286979e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,8 +13,8 @@ pipeline { echo "Building.." sh ''' cd myapp - python3 -m venv .venv - source ~/.venv/bin/activate + python3 -m venv /opt/venv + source /opt/venv/bin/activate pip3 install -r requirements.txt ''' } From dc4ee518be2f0ec03f3e45e19ad2a404dc7a6e7c Mon Sep 17 00:00:00 2001 From: zhouxinyang Date: Tue, 23 Jan 2024 20:11:04 +0400 Subject: [PATCH 06/10] modify activate path --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a286979e..fd4a3ad0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,8 +13,8 @@ pipeline { echo "Building.." sh ''' cd myapp - python3 -m venv /opt/venv - source /opt/venv/bin/activate + python3 -m venv ~/.venv + source ~/.venv/bin/activate pip3 install -r requirements.txt ''' } From 1388316075d736cf975ec7992c6389df1a8eab7a Mon Sep 17 00:00:00 2001 From: zhouxinyang Date: Wed, 24 Jan 2024 10:18:02 +0400 Subject: [PATCH 07/10] modify activate path --- Jenkinsfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index fd4a3ad0..65912db8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,11 @@ pipeline { pollSCM '* * * * *' } stages { + stage('Pull') { + steps { + git branch: '${branch}, url: 'https://github.com/ningzaichun/hello-springboot' + } + } stage('Build') { steps { echo "Building.." @@ -15,6 +20,7 @@ pipeline { cd myapp python3 -m venv ~/.venv source ~/.venv/bin/activate + pip3 install --upgrade pip3 pip3 install -r requirements.txt ''' } @@ -24,6 +30,7 @@ pipeline { echo "Testing.." sh ''' cd myapp + source ~/.venv/bin/activate python3 hello.py python3 hello.py --name=Brad ''' From 23e5d853cdff10a8bd3bd9cb530d6577a4219409 Mon Sep 17 00:00:00 2001 From: zhouxinyang Date: Wed, 24 Jan 2024 10:19:20 +0400 Subject: [PATCH 08/10] modify activate path --- Jenkinsfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 65912db8..a7dbffb5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,11 +8,6 @@ pipeline { pollSCM '* * * * *' } stages { - stage('Pull') { - steps { - git branch: '${branch}, url: 'https://github.com/ningzaichun/hello-springboot' - } - } stage('Build') { steps { echo "Building.." From 0eb4498a8f88ff1b10472cff0347c3f6bc49bfd5 Mon Sep 17 00:00:00 2001 From: zhouxinyang Date: Wed, 24 Jan 2024 10:21:08 +0400 Subject: [PATCH 09/10] modify activate path --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a7dbffb5..99276c34 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,6 @@ pipeline { cd myapp python3 -m venv ~/.venv source ~/.venv/bin/activate - pip3 install --upgrade pip3 pip3 install -r requirements.txt ''' } From 79aec6606e86185759495158dfe0dd812545654d Mon Sep 17 00:00:00 2001 From: zhouxinyang Date: Thu, 25 Jan 2024 14:17:17 +0400 Subject: [PATCH 10/10] modify activate path --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 99276c34..e59f0466 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent { node { - label 'docker-agent-alpine-python' + label 'docker-agent-alpine-python-node' } } triggers {