From 95b4beb40bb8c9b6e8dc9a678af4c3207e62b61c Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Wed, 19 Jan 2022 23:22:37 +0000 Subject: [PATCH 01/38] poll build now --- vote/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vote/app.py b/vote/app.py index db5ff2e4d8..53248954de 100644 --- a/vote/app.py +++ b/vote/app.py @@ -20,6 +20,7 @@ def get_redis(): @app.route("/", methods=['POST','GET']) def hello(): voter_id = request.cookies.get('voter_id') + # test comment if not voter_id: voter_id = hex(random.getrandbits(64))[2:-1] From 85b2b2fe18802d2a9a5732ea92a96c93c36c11bd Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Wed, 19 Jan 2022 23:24:14 +0000 Subject: [PATCH 02/38] agaion --- vote/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vote/app.py b/vote/app.py index 53248954de..1eb1228adb 100644 --- a/vote/app.py +++ b/vote/app.py @@ -20,7 +20,7 @@ def get_redis(): @app.route("/", methods=['POST','GET']) def hello(): voter_id = request.cookies.get('voter_id') - # test comment + # test comment now if not voter_id: voter_id = hex(random.getrandbits(64))[2:-1] From b6263d1121cf18bfe9bbd4f71a78fcf59f11a93d Mon Sep 17 00:00:00 2001 From: rsiwicki Date: Wed, 19 Jan 2022 23:36:59 +0000 Subject: [PATCH 03/38] adding readme --- worker/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 worker/README.md diff --git a/worker/README.md b/worker/README.md new file mode 100644 index 0000000000..79af3c8ca9 --- /dev/null +++ b/worker/README.md @@ -0,0 +1 @@ +## Worker Java App From 01b9468d89a793f66f37825e2166e8edec2de935 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 07:16:23 +0000 Subject: [PATCH 04/38] added reamde info --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b8ad8a94af..74c8dbecf1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Example Voting App ========= +This a test + Getting started --------------- From a5e94dc974d6abcb620a18d1721649a26e9a51d5 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 09:04:38 +0000 Subject: [PATCH 05/38] added jenkinsfile --- worker/Jenkinsfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 worker/Jenkinsfile diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile new file mode 100644 index 0000000000..127aa83fb5 --- /dev/null +++ b/worker/Jenkinsfile @@ -0,0 +1,34 @@ +pipeline { + agent any + + tools{ + maven 'Maven 3.6.1' + } + + + stages { + stage('build') { + steps { + echo 'Compile' + dir['worker'] { + sh 'mvn compile' + } + } + } + stage('test') { + steps { + echo 'Test' + } + } + stage('package') { + steps { + echo 'Package' + } + } + } + post { + always { + echo 'This pipeline is completed' + } + } +} From c43bf1595c28361bfe087720c9196d07afbfd748 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 15:21:26 +0000 Subject: [PATCH 06/38] added test and package jobs to worker pipeline --- worker/Jenkinsfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 127aa83fb5..f228bd0e31 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -10,20 +10,25 @@ pipeline { stage('build') { steps { echo 'Compile' - dir['worker'] { + dir('worker') { sh 'mvn compile' } } } stage('test') { steps { - echo 'Test' + dir('worker') { + echo 'mvn clean test' + } } } stage('package') { + steps { - echo 'Package' - } + dir('worker') { + echo 'mvn package' + } + } } } post { From 962ca2e6ec4f4564375155a4276c0bdf607301b6 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 15:32:33 +0000 Subject: [PATCH 07/38] suped the complete message --- worker/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index f228bd0e31..675083cb41 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -27,13 +27,13 @@ pipeline { steps { dir('worker') { echo 'mvn package' - } + } } } } post { always { - echo 'This pipeline is completed' + echo 'This pipeline is completed now' } } } From c3226d2f6b2573547abae24f1603292e4821a4ed Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 15:40:09 +0000 Subject: [PATCH 08/38] run archival --- worker/Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 675083cb41..ec594f5ffa 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -26,13 +26,15 @@ pipeline { steps { dir('worker') { - echo 'mvn package' + echo 'mvn package -DskipTess' } } } + } post { always { + archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true echo 'This pipeline is completed now' } } From 5378f4b2355feb24de76380520ec258f94dbd47b Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 15:46:39 +0000 Subject: [PATCH 09/38] 2 --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index ec594f5ffa..5ce48c41f4 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -26,7 +26,7 @@ pipeline { steps { dir('worker') { - echo 'mvn package -DskipTess' + echo 'mvn package -DskipTests' } } } From ad3073e9426eab8204f5626e65b7d28127318f5a Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 15:58:46 +0000 Subject: [PATCH 10/38] fixed --- worker/Jenkinsfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 5ce48c41f4..571e8d6230 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -9,7 +9,6 @@ pipeline { stages { stage('build') { steps { - echo 'Compile' dir('worker') { sh 'mvn compile' } @@ -18,7 +17,7 @@ pipeline { stage('test') { steps { dir('worker') { - echo 'mvn clean test' + sh 'mvn clean test' } } } @@ -26,12 +25,12 @@ pipeline { steps { dir('worker') { - echo 'mvn package -DskipTests' + sh 'mvn package -DskipTests' } } } - } + post { always { archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true From 3de404c2e477f08233783d97e7d63a2aed07748a Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 20:57:25 +0000 Subject: [PATCH 11/38] run packaging step only for master, run stagesion only when worker code chagnes --- worker/Jenkinsfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 571e8d6230..830f193473 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -8,6 +8,9 @@ pipeline { stages { stage('build') { + when { + changeset '**/worker/**' + } steps { dir('worker') { sh 'mvn compile' @@ -15,6 +18,9 @@ pipeline { } } stage('test') { + when { + changeset '**/worker/**' + } steps { dir('worker') { sh 'mvn clean test' @@ -22,10 +28,14 @@ pipeline { } } stage('package') { - + when { + branch 'master' + changeset '**/worker/**' + } steps { dir('worker') { sh 'mvn package -DskipTests' + archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true } } } @@ -33,7 +43,6 @@ pipeline { post { always { - archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true echo 'This pipeline is completed now' } } From d3dede5023d5b270ebc6d68c50efb847e1fe9b28 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 09:44:42 +0000 Subject: [PATCH 12/38] smileyface --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 830f193473..6c28e7d766 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -43,7 +43,7 @@ pipeline { post { always { - echo 'This pipeline is completed now' + echo 'This pipeline is completed now :-)' } } } From b0c7e735eda15ab813966bf24e4b9a46e875b531 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 10:20:01 +0000 Subject: [PATCH 13/38] added jenkins file for result app --- result/Jenkinsfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 result/Jenkinsfile diff --git a/result/Jenkinsfile b/result/Jenkinsfile new file mode 100644 index 0000000000..f174163de7 --- /dev/null +++ b/result/Jenkinsfile @@ -0,0 +1,37 @@ +pipeline { + agent any + + tools{ + maven 'NodeJS 8.9.0' + } + + + stages { + stage('build') { + when { + changeset '**/result/**' + } + steps { + dir('result') { + sh 'npm install' + } + } + } + stage('test') { + when { + changeset '**/result/**' + } + steps { + dir('result') { + sh 'npm install' + sh 'npm test' + } + } + } + } + post { + always { + echo 'This pipeline is completed now :-)' + } + } +} From c801885527848e385bebdb7ce0cc1c17fe002bab Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 10:30:57 +0000 Subject: [PATCH 14/38] added a dev test --- result/test/mock.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/result/test/mock.test.js b/result/test/mock.test.js index f99dfdae97..bdcd486e79 100644 --- a/result/test/mock.test.js +++ b/result/test/mock.test.js @@ -26,4 +26,10 @@ describe('mock test 4', () => { }); }); +describe('mock test 5', () => { + it('unit test 5', () => { + expect(true).to.be.true; + }); +}); + From 5614c9b9b4a74ff86268cd0c5310ea7d2ad281f2 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 10:38:18 +0000 Subject: [PATCH 15/38] fix nodejs bug --- result/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/result/Jenkinsfile b/result/Jenkinsfile index f174163de7..24112f7044 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any tools{ - maven 'NodeJS 8.9.0' + nodejs 'NodeJS 8.9.0' } From c223aec2f3421015349b19ac8b6a8f44ac0e49e3 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 11:03:21 +0000 Subject: [PATCH 16/38] blah blah --- result/test/mock.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/result/test/mock.test.js b/result/test/mock.test.js index bdcd486e79..17dddfaf4c 100644 --- a/result/test/mock.test.js +++ b/result/test/mock.test.js @@ -26,7 +26,7 @@ describe('mock test 4', () => { }); }); -describe('mock test 5', () => { +describe('mock test 5 blah', () => { it('unit test 5', () => { expect(true).to.be.true; }); From e27303857f04decb88675d5fbd73e61ba1f4a3c0 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 18:41:57 +0000 Subject: [PATCH 17/38] user docker agent insted of maven --- worker/Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 6c28e7d766..8589da58e7 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -1,11 +1,11 @@ pipeline { - agent any - - tools{ - maven 'Maven 3.6.1' + agent { + docker { + image 'maven:3.6.1-jdk-8-alpine' + args '-v $HOME/.m2:/root/.m2' + } } - stages { stage('build') { when { From a57084858546edc277a76deffb237cfd2eb12db4 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 18:51:35 +0000 Subject: [PATCH 18/38] user docker agent insted of maven obs --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 8589da58e7..8c479ee89a 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -43,7 +43,7 @@ pipeline { post { always { - echo 'This pipeline is completed now :-)' + echo 'This pipeline is completed now :-) :-) :-)' } } } From 08d4db840fef067b2c26ee31530c397d439f2637 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 19:04:18 +0000 Subject: [PATCH 19/38] implement test 5 --- worker/src/test/java/worker/UnitWorker.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/worker/src/test/java/worker/UnitWorker.java b/worker/src/test/java/worker/UnitWorker.java index cb5d513961..a58f6b604d 100644 --- a/worker/src/test/java/worker/UnitWorker.java +++ b/worker/src/test/java/worker/UnitWorker.java @@ -22,4 +22,10 @@ void sample3() { void sample4() { } + + @Test + void sample5() { + + } + } From f8f96d8190c3658cb69326e80d3ff7f7bce9a7bd Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 19:12:25 +0000 Subject: [PATCH 20/38] docker for node app --- result/Jenkinsfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 24112f7044..631a22326f 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -1,11 +1,10 @@ pipeline { - agent any - - tools{ - nodejs 'NodeJS 8.9.0' + agent { + docker { + image 'node:8.16.0-alpha' + } } - stages { stage('build') { when { From dbb8f498ecc20f59d1936f3235183de824fa704e Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 19:14:00 +0000 Subject: [PATCH 21/38] docker for node app again --- result/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 631a22326f..3f973cfc1e 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent { docker { - image 'node:8.16.0-alpha' + image 'node:8.16.0-alpine' } } From bfc023f4975b6571ed9031296f53618c9003532f Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 19:27:18 +0000 Subject: [PATCH 22/38] start autobuild file --- vote/Jenkinsfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 vote/Jenkinsfile diff --git a/vote/Jenkinsfile b/vote/Jenkinsfile new file mode 100644 index 0000000000..ec6d5153a2 --- /dev/null +++ b/vote/Jenkinsfile @@ -0,0 +1,35 @@ +pipeline { + agent { + docker { + image 'python:2.7.16-slim' + } + } + + stages { + stage('build') { + when { + changeset '**/vote/**' + } + steps { + dir('vote') { + sh 'pip install -r requirements.txt' + } + } + } + stage('test') { + when { + changeset '**/vote/**' + } + steps { + dir('vote') { + sh 'nosetests -v' + } + } + } + } + post { + always { + echo 'This pipeline is completed now :-)' + } + } +} From ef2ed91fee655260c6d20fba1d59692c735adb3f Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 19:39:22 +0000 Subject: [PATCH 23/38] load --- vote/tests/test_frontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vote/tests/test_frontend.py b/vote/tests/test_frontend.py index 5e3d37a3d1..5a5b9a8306 100644 --- a/vote/tests/test_frontend.py +++ b/vote/tests/test_frontend.py @@ -12,7 +12,7 @@ def setUp(self): def test_home_status_code(self): - """Assert that the home page loads successfully""" + """Assert that the home page loadz successfully""" result = self.app.get('/') self.assertEqual(result.status_code, 200) From 22c494f0e56ad9ae65b26d84f5dfe76a1f375463 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 19:43:03 +0000 Subject: [PATCH 24/38] root user --- vote/Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/vote/Jenkinsfile b/vote/Jenkinsfile index ec6d5153a2..d39ffc0ee8 100644 --- a/vote/Jenkinsfile +++ b/vote/Jenkinsfile @@ -2,6 +2,7 @@ pipeline { agent { docker { image 'python:2.7.16-slim' + args '--user root' } } From a484e81ec839a54f7b6d3c41e935ef3ba944a28d Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 21:26:05 +0000 Subject: [PATCH 25/38] added dockerfiles for worker apps --- result/Jenkinsfile | 36 +++++++++++++++++++++ result/test/mock.test.js | 6 ++++ vote/Jenkinsfile | 36 +++++++++++++++++++++ vote/tests/test_frontend.py | 2 +- worker/Dockerfile | 11 +++++++ worker/Jenkinsfile | 9 ++++-- worker/src/test/java/worker/UnitWorker.java | 6 ++++ 7 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 result/Jenkinsfile create mode 100644 vote/Jenkinsfile create mode 100644 worker/Dockerfile diff --git a/result/Jenkinsfile b/result/Jenkinsfile new file mode 100644 index 0000000000..3f973cfc1e --- /dev/null +++ b/result/Jenkinsfile @@ -0,0 +1,36 @@ +pipeline { + agent { + docker { + image 'node:8.16.0-alpine' + } + } + + stages { + stage('build') { + when { + changeset '**/result/**' + } + steps { + dir('result') { + sh 'npm install' + } + } + } + stage('test') { + when { + changeset '**/result/**' + } + steps { + dir('result') { + sh 'npm install' + sh 'npm test' + } + } + } + } + post { + always { + echo 'This pipeline is completed now :-)' + } + } +} diff --git a/result/test/mock.test.js b/result/test/mock.test.js index f99dfdae97..17dddfaf4c 100644 --- a/result/test/mock.test.js +++ b/result/test/mock.test.js @@ -26,4 +26,10 @@ describe('mock test 4', () => { }); }); +describe('mock test 5 blah', () => { + it('unit test 5', () => { + expect(true).to.be.true; + }); +}); + diff --git a/vote/Jenkinsfile b/vote/Jenkinsfile new file mode 100644 index 0000000000..d39ffc0ee8 --- /dev/null +++ b/vote/Jenkinsfile @@ -0,0 +1,36 @@ +pipeline { + agent { + docker { + image 'python:2.7.16-slim' + args '--user root' + } + } + + stages { + stage('build') { + when { + changeset '**/vote/**' + } + steps { + dir('vote') { + sh 'pip install -r requirements.txt' + } + } + } + stage('test') { + when { + changeset '**/vote/**' + } + steps { + dir('vote') { + sh 'nosetests -v' + } + } + } + } + post { + always { + echo 'This pipeline is completed now :-)' + } + } +} diff --git a/vote/tests/test_frontend.py b/vote/tests/test_frontend.py index 5e3d37a3d1..5a5b9a8306 100644 --- a/vote/tests/test_frontend.py +++ b/vote/tests/test_frontend.py @@ -12,7 +12,7 @@ def setUp(self): def test_home_status_code(self): - """Assert that the home page loads successfully""" + """Assert that the home page loadz successfully""" result = self.app.get('/') self.assertEqual(result.status_code, 200) diff --git a/worker/Dockerfile b/worker/Dockerfile new file mode 100644 index 0000000000..1264902a0f --- /dev/null +++ b/worker/Dockerfile @@ -0,0 +1,11 @@ +FROM maven:3.6.1-jdk-8-alpine + +WORKDIR /app + +COPY . . + +RUN mvn package -DskipTests && \ + mv target/worker-jar-with-dependencies.jar /run/worker.jar && \ + rm -rf * + +CMD java -jar /run/worker.jar diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 6c28e7d766..856b06a924 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -1,8 +1,11 @@ pipeline { agent any - tools{ - maven 'Maven 3.6.1' + agent { + docker { + image 'maven:3.6.1-jdk-8-alpine' + args '-v $HOME/.m2:/root/.m2' + } } @@ -43,7 +46,7 @@ pipeline { post { always { - echo 'This pipeline is completed now :-)' + echo 'This pipeline is completed now' } } } diff --git a/worker/src/test/java/worker/UnitWorker.java b/worker/src/test/java/worker/UnitWorker.java index cb5d513961..a58f6b604d 100644 --- a/worker/src/test/java/worker/UnitWorker.java +++ b/worker/src/test/java/worker/UnitWorker.java @@ -22,4 +22,10 @@ void sample3() { void sample4() { } + + @Test + void sample5() { + + } + } From 9fc331353d0f7b593f703838aeaffe55db4891b2 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 21:45:23 +0000 Subject: [PATCH 26/38] I docker image a build --- worker/Jenkinsfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 856b06a924..2488d3b22d 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -42,6 +42,25 @@ pipeline { } } } + + stage('docker-package') { + when { + branch 'master' + changeset '**/worker/**' + } + steps { + echo 'worker app with docker' + script { + docker.withRegistry('https://index.docker.io/v1', 'dockerlogin'){ + def workerImage = docker.build("robrockdataio/worker:v${env.BUILD_ID}","./worker") + workerImage.push() + workerImage.push("${env.BRANCH_NAME}") + } + } + } + } + + } post { From 8f3456f83c5568166b67f4ab5c3effd2a08c9a9d Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 21:54:13 +0000 Subject: [PATCH 27/38] remove master branch --- worker/Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 2488d3b22d..4a3a9046d7 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -45,7 +45,6 @@ pipeline { stage('docker-package') { when { - branch 'master' changeset '**/worker/**' } steps { From 4b14e116f842ad2aa0b46f853e8c426bb067bac9 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 22:14:12 +0000 Subject: [PATCH 28/38] I agent for multi --- worker/Jenkinsfile | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 4a3a9046d7..5556df0b43 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -1,16 +1,15 @@ pipeline { - agent any - - agent { - docker { - image 'maven:3.6.1-jdk-8-alpine' - args '-v $HOME/.m2:/root/.m2' - } - } + agent none stages { stage('build') { + agent{ + docker { + image: 'maven:3.6.1-jdk-9-alpine' + args '-v $HOME/.m2:/root/.m2' + } + } when { changeset '**/worker/**' } @@ -21,7 +20,13 @@ pipeline { } } stage('test') { - when { + agent{ + docker { + image: 'maven:3.6.1-jdk-9-alpine' + args '-v $HOME/.m2:/root/.m2' + } + } + when { changeset '**/worker/**' } steps { @@ -31,7 +36,13 @@ pipeline { } } stage('package') { - when { + agent{ + docker { + image: 'maven:3.6.1-jdk-9-alpine' + args '-v $HOME/.m2:/root/.m2' + } + } + when { branch 'master' changeset '**/worker/**' } @@ -44,6 +55,7 @@ pipeline { } stage('docker-package') { + agent any when { changeset '**/worker/**' } From 8523968231aaf1bacce761aa27daf1224c0dac72 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 22:20:19 +0000 Subject: [PATCH 29/38] I agent for multi d --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 5556df0b43..7e95b2f357 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -76,7 +76,7 @@ pipeline { post { always { - echo 'This pipeline is completed now' + echo 'This pipeline is completed now dockerized :-)' } } } From e89a812fe32c823e5b09895ab71f1fe31c440c45 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 22:25:24 +0000 Subject: [PATCH 30/38] RemoVe colon --- worker/Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 7e95b2f357..8a50fae207 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { stage('build') { agent{ docker { - image: 'maven:3.6.1-jdk-9-alpine' + image 'maven:3.6.1-jdk-9-alpine' args '-v $HOME/.m2:/root/.m2' } } @@ -22,7 +22,7 @@ pipeline { stage('test') { agent{ docker { - image: 'maven:3.6.1-jdk-9-alpine' + image 'maven:3.6.1-jdk-9-alpine' args '-v $HOME/.m2:/root/.m2' } } @@ -38,7 +38,7 @@ pipeline { stage('package') { agent{ docker { - image: 'maven:3.6.1-jdk-9-alpine' + image 'maven:3.6.1-jdk-9-alpine' args '-v $HOME/.m2:/root/.m2' } } From e23573c8f9e4c510c9d6547b830d876c20f70d3a Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 22:27:50 +0000 Subject: [PATCH 31/38] version --- worker/Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 8a50fae207..5f4d9746ad 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { stage('build') { agent{ docker { - image 'maven:3.6.1-jdk-9-alpine' + image 'maven:3.6.1-jdk-8-alpine' args '-v $HOME/.m2:/root/.m2' } } @@ -22,7 +22,7 @@ pipeline { stage('test') { agent{ docker { - image 'maven:3.6.1-jdk-9-alpine' + image 'maven:3.6.1-jdk-8-alpine' args '-v $HOME/.m2:/root/.m2' } } @@ -38,7 +38,7 @@ pipeline { stage('package') { agent{ docker { - image 'maven:3.6.1-jdk-9-alpine' + image 'maven:3.6.1-jdk-8-alpine' args '-v $HOME/.m2:/root/.m2' } } From 683d7d709b4663d0218b311645c97281ecdea9cc Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 22:34:14 +0000 Subject: [PATCH 32/38] version --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 5f4d9746ad..076f099fbc 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -76,7 +76,7 @@ pipeline { post { always { - echo 'This pipeline is completed now dockerized :-)' + echo 'This pipeline is completed now dockerized >-)' } } } From f1ccbe6fe3e47559d3f78c17c78d892745c679fc Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 22:41:20 +0000 Subject: [PATCH 33/38] version --- worker/Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 076f099fbc..518de5122f 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -65,7 +65,6 @@ pipeline { docker.withRegistry('https://index.docker.io/v1', 'dockerlogin'){ def workerImage = docker.build("robrockdataio/worker:v${env.BUILD_ID}","./worker") workerImage.push() - workerImage.push("${env.BRANCH_NAME}") } } } From a3b05bb9978bde0e1b5318581872843388797b08 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 22:47:06 +0000 Subject: [PATCH 34/38] version --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 518de5122f..7e3d3a0571 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -62,7 +62,7 @@ pipeline { steps { echo 'worker app with docker' script { - docker.withRegistry('https://index.docker.io/v1', 'dockerlogin'){ + docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin'){ def workerImage = docker.build("robrockdataio/worker:v${env.BUILD_ID}","./worker") workerImage.push() } From 6ba6f2d4dd709d39c7ff89611dabd471f9b5632e Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 22:55:36 +0000 Subject: [PATCH 35/38] package --- worker/Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 7e3d3a0571..8849df5b40 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -58,6 +58,7 @@ pipeline { agent any when { changeset '**/worker/**' + branch 'master' } steps { echo 'worker app with docker' @@ -65,6 +66,7 @@ pipeline { docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin'){ def workerImage = docker.build("robrockdataio/worker:v${env.BUILD_ID}","./worker") workerImage.push() + workerImage.push("${env.BRANCH_NAME}") } } } From 252ba012123a76424c68e540c0a0ab10afcef2de Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 23:18:51 +0000 Subject: [PATCH 36/38] so docker file --- result/Jenkinsfile | 34 +++++++++++++++++++++++++++++----- vote/Jenkinsfile | 39 +++++++++++++++++++++++++++++++++------ 2 files changed, 62 insertions(+), 11 deletions(-) diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 3f973cfc1e..ee62c45628 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -1,12 +1,13 @@ pipeline { - agent { - docker { - image 'node:8.16.0-alpine' - } - } + agent none stages { stage('build') { + agent { + docker { + image 'node:8.16.0-alpine' + } + } when { changeset '**/result/**' } @@ -17,6 +18,11 @@ pipeline { } } stage('test') { + agent { + docker { + image 'node:8.16.0-alpine' + } + } when { changeset '**/result/**' } @@ -27,6 +33,24 @@ pipeline { } } } + stage('docker-package') { + agent any + when { + changeset '**/result/**' + branch 'master' + } + steps { + echo 'worker app with docker' + script { + docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin'){ + def workerImage = docker.build("robrockdataio/result:v${env.BUILD_ID}","./result") + workerImage.push() + workerImage.push("${env.BRANCH_NAME}") + } + } + } + } + } post { always { diff --git a/vote/Jenkinsfile b/vote/Jenkinsfile index d39ffc0ee8..adf8e9b202 100644 --- a/vote/Jenkinsfile +++ b/vote/Jenkinsfile @@ -1,13 +1,14 @@ pipeline { - agent { - docker { - image 'python:2.7.16-slim' - args '--user root' - } - } + agent none stages { stage('build') { + agent { + docker { + image 'python:2.7.16-slim' + args '--user root' + } + } when { changeset '**/vote/**' } @@ -18,6 +19,12 @@ pipeline { } } stage('test') { + agent { + docker { + image 'python:2.7.16-slim' + args '--user root' + } + } when { changeset '**/vote/**' } @@ -27,6 +34,26 @@ pipeline { } } } + + stage('docker-package') { + agent any + when { + changeset '**/vote/**' + branch 'master' + } + steps { + echo 'worker app with docker' + script { + docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin'){ + def workerImage = docker.build("robrockdataio/vote:v${env.BUILD_ID}","./vote") + workerImage.push() + workerImage.push("${env.BRANCH_NAME}") + } + } + } + } + + } post { always { From eceeaa961d3fb50963b5846907ca13d67ec309ab Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sun, 23 Jan 2022 00:02:24 +0000 Subject: [PATCH 37/38] tris branch --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 0dfac724fd..53d19cea2c 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -77,7 +77,7 @@ pipeline { post { always { - echo 'This pipeline is completed now dockerized >-)' + echo 'This pipeline is completed now dockerized >-) >-) >-)' } } From f39f663e3cdb742a23af688df29fc3fc395bb734 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sun, 23 Jan 2022 00:15:36 +0000 Subject: [PATCH 38/38] :-) --- result/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/result/Jenkinsfile b/result/Jenkinsfile index ee62c45628..0d6e512b45 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -54,7 +54,7 @@ pipeline { } post { always { - echo 'This pipeline is completed now :-)' + echo 'This pipeline is completed now :-) >-) :-)' } } }