From 6419a7a634df6add14de1dfab7c7568dbca274f2 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Sat, 8 Aug 2020 19:24:12 +0200 Subject: [PATCH 01/31] piccola modifichetta al readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b8ad8a94af..b2753b6a80 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ Example Voting App ========= + Getting started --------------- From 94f5e8876dd9cbf532883a86a8d425ad628b8ff1 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Sat, 8 Aug 2020 19:28:35 +0200 Subject: [PATCH 02/31] altra piccola modifichetta al readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2753b6a80..8d2eadc14b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Example Voting App ========= - +addedd by me Getting started --------------- From 45491a36127d358c36da1fa762411cbc2571710f Mon Sep 17 00:00:00 2001 From: neo-acap <68500599+neo-acap@users.noreply.github.com> Date: Sat, 8 Aug 2020 22:49:08 +0200 Subject: [PATCH 03/31] Create mio.txt --- mio.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 mio.txt diff --git a/mio.txt b/mio.txt new file mode 100644 index 0000000000..c552f004a8 --- /dev/null +++ b/mio.txt @@ -0,0 +1 @@ +file di test From d0ff05c2a50d462bfcdc3b90cef3f120ec2a1028 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Sat, 8 Aug 2020 22:55:57 +0200 Subject: [PATCH 04/31] editato ancora --- mio.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/mio.txt b/mio.txt index c552f004a8..3f496b9fc1 100644 --- a/mio.txt +++ b/mio.txt @@ -1 +1,2 @@ file di test +editato in locale From 7e70afb4332e94a16b5bfcaf704a7d07dd6e9e8c Mon Sep 17 00:00:00 2001 From: armando caprini Date: Tue, 11 Aug 2020 15:04:14 +0200 Subject: [PATCH 05/31] ripristinato readme corretto --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 8d2eadc14b..b8ad8a94af 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ Example Voting App ========= -addedd by me Getting started --------------- From e754ff50cc96db14ec10174604f7a381d1acd602 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Tue, 11 Aug 2020 16:00:44 +0200 Subject: [PATCH 06/31] aggiunto Jenkinsfile --- worker/Jenkinsfile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 worker/Jenkinsfile diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile new file mode 100644 index 0000000000..09aecb9385 --- /dev/null +++ b/worker/Jenkinsfile @@ -0,0 +1,38 @@ +pipeline { + + agent any + + tools{ + maven 'maven 3.6.1' + } + + stages{ + + stage("build){ + steps{ + echo 'Compiling worker app' + dir('worker'){ + sh 'mvn compile' + } + } + } + + stage(two){ + steps{ + echo 'Running Unit Tets on worker app' + } + } + + stage(three){ + steps{ + echo 'Packaging worker app' + } + } + } + + post{ + always{ + echo 'Building multibranch pipeline for worker is completed..' + } + } +} From 5adaa90a31203a66f1107d0ad6ffc8e6860894b3 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Tue, 11 Aug 2020 18:51:48 +0200 Subject: [PATCH 07/31] corretto Jenkinsfile --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 09aecb9385..68e27fa410 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -8,7 +8,7 @@ pipeline { stages{ - stage("build){ + stage("build"){ steps{ echo 'Compiling worker app' dir('worker'){ From 6f2b71651f95322b57e53409db1e22c7e7ade68d Mon Sep 17 00:00:00 2001 From: armando caprini Date: Tue, 11 Aug 2020 19:00:27 +0200 Subject: [PATCH 08/31] changed Jenkinsfile added test and package --- worker/Jenkinsfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 68e27fa410..223d0ba06e 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -20,12 +20,18 @@ pipeline { stage(two){ steps{ echo 'Running Unit Tets on worker app' + dir('worker'){ + sh 'mvn clean test' + } } } stage(three){ steps{ echo 'Packaging worker app' + dir('worker'){ + sh 'mvn package' + } } } } From 70d13c4824f13d080e3c31460295ed7514552a93 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Tue, 11 Aug 2020 19:04:26 +0200 Subject: [PATCH 09/31] changed Jenkinsfile added archiving artifacts --- worker/Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 223d0ba06e..e77447f14f 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -30,7 +30,7 @@ pipeline { steps{ echo 'Packaging worker app' dir('worker'){ - sh 'mvn package' + sh 'mvn package -DskipTests' } } } @@ -38,7 +38,8 @@ pipeline { post{ always{ + archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true echo 'Building multibranch pipeline for worker is completed..' - } } + } } From ef01bb744ab9f496262c8c50d9fd81cd3cedc593 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Tue, 11 Aug 2020 19:19:30 +0200 Subject: [PATCH 10/31] changed Jenkinsfile added conditional eecution --- worker/Jenkinsfile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index e77447f14f..9694b6c650 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -9,6 +9,11 @@ pipeline { stages{ stage("build"){ + + when{ + changeset "**/worker/**" + } + steps{ echo 'Compiling worker app' dir('worker'){ @@ -18,6 +23,11 @@ pipeline { } stage(two){ + + when{ + changeset "**/worker/**" + } + steps{ echo 'Running Unit Tets on worker app' dir('worker'){ @@ -27,10 +37,17 @@ pipeline { } stage(three){ + + when{ + branch 'master' + changeset "**/worker/**" + } + steps{ echo 'Packaging worker app' dir('worker'){ sh 'mvn package -DskipTests' + archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true } } } @@ -38,7 +55,6 @@ pipeline { post{ always{ - archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true echo 'Building multibranch pipeline for worker is completed..' } } From d69ae465938e2d5f34bf538570ee137d6a3341e3 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Wed, 12 Aug 2020 17:17:25 +0200 Subject: [PATCH 11/31] aggiunto Jenkinsfile x app result --- result/Jenkinsfile | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 result/Jenkinsfile diff --git a/result/Jenkinsfile b/result/Jenkinsfile new file mode 100644 index 0000000000..279f8e662c --- /dev/null +++ b/result/Jenkinsfile @@ -0,0 +1,48 @@ +pipeline { + + agent any + + tools{ + nodejs 'Node Js 8.9.0' + } + + stages{ + + stage("build"){ + + when{ + changeset "**/result/**" + } + + steps{ + echo 'building result app' + dir('result'){ + sh 'npm install' + } + } + } + + stage("test"){ + + when{ + changeset "**/result/**" + } + + steps{ + echo 'Running Unit Tets on result app' + dir('result'){ + sh 'npm install' + sh 'npm test' + } + } + } + + + } + + post{ + always{ + echo 'Fatto tutto. Benbrai..' + } + } +} From 942a1e9a7db8058077c0d79248d77c2d5067092c Mon Sep 17 00:00:00 2001 From: armando caprini Date: Wed, 12 Aug 2020 17:25:12 +0200 Subject: [PATCH 12/31] aggiunto commento al Dockerfile --- result/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/result/Dockerfile b/result/Dockerfile index 2bca93313a..9db779954d 100644 --- a/result/Dockerfile +++ b/result/Dockerfile @@ -1,5 +1,5 @@ FROM node:8.9-alpine - +# added just for pleasure RUN mkdir -p /app WORKDIR /app From 13d95a6f29ee9b7d370dad31e29424dfbf1b14dd Mon Sep 17 00:00:00 2001 From: armando caprini Date: Wed, 12 Aug 2020 17:46:34 +0200 Subject: [PATCH 13/31] tolto commento su Dockerfile --- result/Dockerfile | 2 +- result/Jenkinsfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/result/Dockerfile b/result/Dockerfile index 9db779954d..2bca93313a 100644 --- a/result/Dockerfile +++ b/result/Dockerfile @@ -1,5 +1,5 @@ FROM node:8.9-alpine -# added just for pleasure + RUN mkdir -p /app WORKDIR /app diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 279f8e662c..2deffedcdd 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -42,6 +42,7 @@ pipeline { post{ always{ + office365ConnectorSend webhookURL:"https://outlook.office.com/webhook/d7e57a03-28cd-4e67-ac98-d6fade5ef679@33d0cf59-4d7e-4112-aeaf-6a520949bd17/JenkinsCI/8a2a930e0a6a4e1ebafa98dbc8eb540b/9d6022fa-c1d6-4751-bf90-2d20ddd69469" message:"started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)" echo 'Fatto tutto. Benbrai..' } } From a49f0dad5f1317e00bdebc277491c9e20da7ed60 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Wed, 12 Aug 2020 17:50:35 +0200 Subject: [PATCH 14/31] aggiunto commento al Dockerfile --- result/Dockerfile | 2 +- result/Jenkinsfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/result/Dockerfile b/result/Dockerfile index 2bca93313a..a4637507a4 100644 --- a/result/Dockerfile +++ b/result/Dockerfile @@ -1,5 +1,5 @@ FROM node:8.9-alpine - +# commento RUN mkdir -p /app WORKDIR /app diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 2deffedcdd..7622a7e348 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -42,6 +42,7 @@ pipeline { post{ always{ + echo 'provo a chiamare teams' office365ConnectorSend webhookURL:"https://outlook.office.com/webhook/d7e57a03-28cd-4e67-ac98-d6fade5ef679@33d0cf59-4d7e-4112-aeaf-6a520949bd17/JenkinsCI/8a2a930e0a6a4e1ebafa98dbc8eb540b/9d6022fa-c1d6-4751-bf90-2d20ddd69469" message:"started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)" echo 'Fatto tutto. Benbrai..' } From dccf0c4340a2ce1de39683a757ce1252c1e1516b Mon Sep 17 00:00:00 2001 From: armando caprini Date: Wed, 12 Aug 2020 17:53:58 +0200 Subject: [PATCH 15/31] aggiunto commento al Dockerfile --- result/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 7622a7e348..848eefb197 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -43,7 +43,7 @@ pipeline { post{ always{ echo 'provo a chiamare teams' - office365ConnectorSend webhookURL:"https://outlook.office.com/webhook/d7e57a03-28cd-4e67-ac98-d6fade5ef679@33d0cf59-4d7e-4112-aeaf-6a520949bd17/JenkinsCI/8a2a930e0a6a4e1ebafa98dbc8eb540b/9d6022fa-c1d6-4751-bf90-2d20ddd69469" message:"started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)" + office365ConnectorSend webhookUrl:"https://outlook.office.com/webhook/d7e57a03-28cd-4e67-ac98-d6fade5ef679@33d0cf59-4d7e-4112-aeaf-6a520949bd17/JenkinsCI/8a2a930e0a6a4e1ebafa98dbc8eb540b/9d6022fa-c1d6-4751-bf90-2d20ddd69469" message:"started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)" echo 'Fatto tutto. Benbrai..' } } From 319ad4d5fa6570c197e28dfbfa51f743c51bd3b8 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Wed, 12 Aug 2020 18:01:21 +0200 Subject: [PATCH 16/31] aggiunto commento al Dockerfile --- result/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 848eefb197..9f5d5e1383 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -43,7 +43,7 @@ pipeline { post{ always{ echo 'provo a chiamare teams' - office365ConnectorSend webhookUrl:"https://outlook.office.com/webhook/d7e57a03-28cd-4e67-ac98-d6fade5ef679@33d0cf59-4d7e-4112-aeaf-6a520949bd17/JenkinsCI/8a2a930e0a6a4e1ebafa98dbc8eb540b/9d6022fa-c1d6-4751-bf90-2d20ddd69469" message:"started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)" + office365ConnectorSend webhookUrl:"https://outlook.office.com/webhook/d7e57a03-28cd-4e67-ac98-d6fade5ef679@33d0cf59-4d7e-4112-aeaf-6a520949bd17/JenkinsCI/8a2a930e0a6a4e1ebafa98dbc8eb540b/9d6022fa-c1d6-4751-bf90-2d20ddd69469" message:{"started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"} echo 'Fatto tutto. Benbrai..' } } From d28234a067d2278671a23914355e3a7eb05b8a7f Mon Sep 17 00:00:00 2001 From: armando caprini Date: Wed, 12 Aug 2020 18:04:56 +0200 Subject: [PATCH 17/31] aggiunto commento al Dockerfile --- result/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 9f5d5e1383..4bcfb1db01 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -43,7 +43,7 @@ pipeline { post{ always{ echo 'provo a chiamare teams' - office365ConnectorSend webhookUrl:"https://outlook.office.com/webhook/d7e57a03-28cd-4e67-ac98-d6fade5ef679@33d0cf59-4d7e-4112-aeaf-6a520949bd17/JenkinsCI/8a2a930e0a6a4e1ebafa98dbc8eb540b/9d6022fa-c1d6-4751-bf90-2d20ddd69469" message:{"started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"} + office365ConnectorSend webhookUrl:"https://outlook.office.com/webhook/d7e57a03-28cd-4e67-ac98-d6fade5ef679@33d0cf59-4d7e-4112-aeaf-6a520949bd17/JenkinsCI/8a2a930e0a6a4e1ebafa98dbc8eb540b/9d6022fa-c1d6-4751-bf90-2d20ddd69469", message:"started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)" echo 'Fatto tutto. Benbrai..' } } From 4f7c2abe3c696a5789b8e0dd80e4a4e72494b936 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Wed, 12 Aug 2020 18:18:13 +0200 Subject: [PATCH 18/31] corretto jenkinsfile --- result/Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 4bcfb1db01..279f8e662c 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -42,8 +42,6 @@ pipeline { post{ always{ - echo 'provo a chiamare teams' - office365ConnectorSend webhookUrl:"https://outlook.office.com/webhook/d7e57a03-28cd-4e67-ac98-d6fade5ef679@33d0cf59-4d7e-4112-aeaf-6a520949bd17/JenkinsCI/8a2a930e0a6a4e1ebafa98dbc8eb540b/9d6022fa-c1d6-4751-bf90-2d20ddd69469", message:"started ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)" echo 'Fatto tutto. Benbrai..' } } From 7d7ba437f9a2b273249f2af5b104a13e7d964f39 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Thu, 13 Aug 2020 13:44:46 +0200 Subject: [PATCH 19/31] refactor Jenkinsfile - now uses Docker agent --- worker/Jenkinsfile | 64 ++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 42 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 9694b6c650..c1ffc1488f 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -1,61 +1,41 @@ -pipeline { - - agent any - - tools{ - maven 'maven 3.6.1' - } - - stages{ - - stage("build"){ - - when{ - changeset "**/worker/**" +pipeline{ + agent{ + docker{ + image 'maven:3.6.1-jdk-8-slim' + args '-v $HOME/.m2:/root/.m2' } } - steps{ - echo 'Compiling worker app' - dir('worker'){ - sh 'mvn compile' + stages{ + stage('build'){ + steps{ + echo 'building worker app' + dir('worker'){ + sh 'mvn compile' + } } - } } - - stage(two){ - - when{ - changeset "**/worker/**" - } - + stage('test'){ steps{ - echo 'Running Unit Tets on worker app' + echo 'running unit tests on worker app' dir('worker'){ sh 'mvn clean test' } } } - - stage(three){ - - when{ - branch 'master' - changeset "**/worker/**" - } - + stage('package'){ steps{ - echo 'Packaging worker app' + echo 'packaging worker app into a jarfile' dir('worker'){ - sh 'mvn package -DskipTests' - archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true + sh 'mvn package -DskipTests' + archiveArtifacts artifacts: '**/target/*.jar', fingerprint:true } } } - } + } - post{ + post{ always{ - echo 'Building multibranch pipeline for worker is completed..' + echo 'the job is complete' } - } + } } From c610a2e45cf9682f84c7df6cbe686248101e196f Mon Sep 17 00:00:00 2001 From: armando caprini Date: Thu, 13 Aug 2020 13:49:17 +0200 Subject: [PATCH 20/31] piccola modifica al Jenkinsfile --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index c1ffc1488f..8ddb183a91 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -6,7 +6,7 @@ pipeline{ } stages{ - stage('build'){ + stage('uno'){ steps{ echo 'building worker app' dir('worker'){ From 35acc4e3145d9a8d9c5b1d5bbcbdd381d12878d1 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Thu, 13 Aug 2020 13:50:11 +0200 Subject: [PATCH 21/31] modificato file di test --- mio.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/mio.txt b/mio.txt index 3f496b9fc1..8b709a3666 100644 --- a/mio.txt +++ b/mio.txt @@ -1,2 +1,3 @@ file di test editato in locale +aggiunta riga From 934e22a820d59d1bb05e2218dcd81d4deab0ad2e Mon Sep 17 00:00:00 2001 From: armando caprini Date: Thu, 13 Aug 2020 14:56:45 +0200 Subject: [PATCH 22/31] refactor result app --- result/Dockerfile | 2 +- result/Jenkinsfile | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/result/Dockerfile b/result/Dockerfile index a4637507a4..0b6b37abb2 100644 --- a/result/Dockerfile +++ b/result/Dockerfile @@ -1,5 +1,5 @@ FROM node:8.9-alpine -# commento +# RUN mkdir -p /app WORKDIR /app diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 279f8e662c..40e48cd759 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -1,9 +1,9 @@ pipeline { - agent any - - tools{ - nodejs 'Node Js 8.9.0' + agent{ + docker{ + image 'node:8-alpine' + args '-v $HOME/.m2:/root/.m2' } } stages{ @@ -16,6 +16,7 @@ pipeline { steps{ echo 'building result app' + node --version dir('result'){ sh 'npm install' } @@ -31,7 +32,6 @@ pipeline { steps{ echo 'Running Unit Tets on result app' dir('result'){ - sh 'npm install' sh 'npm test' } } From e9b6c460b4e82c2f1c07c7817d0e712f185618fb Mon Sep 17 00:00:00 2001 From: armando caprini Date: Thu, 13 Aug 2020 15:01:33 +0200 Subject: [PATCH 23/31] corretto Jenkinsfile result --- result/Dockerfile | 2 +- result/Jenkinsfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/result/Dockerfile b/result/Dockerfile index 0b6b37abb2..a4637507a4 100644 --- a/result/Dockerfile +++ b/result/Dockerfile @@ -1,5 +1,5 @@ FROM node:8.9-alpine -# +# commento RUN mkdir -p /app WORKDIR /app diff --git a/result/Jenkinsfile b/result/Jenkinsfile index 40e48cd759..b5484d0bd7 100644 --- a/result/Jenkinsfile +++ b/result/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { steps{ echo 'building result app' - node --version + sh 'node --version' dir('result'){ sh 'npm install' } From 6b13807545a2ff06047241fc77d1bf31348b3fe3 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Thu, 13 Aug 2020 15:38:36 +0200 Subject: [PATCH 24/31] jenkinsfile for vote app --- vote/Jenkinsfile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 vote/Jenkinsfile diff --git a/vote/Jenkinsfile b/vote/Jenkinsfile new file mode 100644 index 0000000000..dd30b8eaf4 --- /dev/null +++ b/vote/Jenkinsfile @@ -0,0 +1,47 @@ +pipeline { + + agent{ + docker{ + image 'python' + args '-v $HOME/.m2:/root/.m2' } + } + + stages{ + + stage("build"){ + + when{ + changeset "**/vote/**" + } + + steps{ + echo 'building vote app' + dir('vote'){ + sh 'pip install -i requirements.txt' + } + } + } + + stage("test"){ + + when{ + changeset "**/vote/**" + } + + steps{ + echo 'Running Unit Tets on result app' + dir('vote'){ + sh 'nosetests -v' + } + } + } + + + } + + post{ + always{ + echo 'Fatto tutto pip. Benbrai..' + } + } +} From 147a683d2b62bbfd977e7154dd207011017cce70 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Thu, 13 Aug 2020 15:41:14 +0200 Subject: [PATCH 25/31] small change just to trigger compile --- vote/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vote/Dockerfile b/vote/Dockerfile index f8cf28f26c..34164eb8ab 100644 --- a/vote/Dockerfile +++ b/vote/Dockerfile @@ -1,6 +1,6 @@ # Using official python runtime base image FROM schoolofdevops/voteapp-python:v0.1.0 - +# # Set the application directory WORKDIR /app From 58fbd546250d794d78ecd6671677060e78f132d7 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Thu, 13 Aug 2020 15:45:42 +0200 Subject: [PATCH 26/31] small change just to trigger compile --- vote/Dockerfile | 2 +- vote/Jenkinsfile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vote/Dockerfile b/vote/Dockerfile index 34164eb8ab..f8cf28f26c 100644 --- a/vote/Dockerfile +++ b/vote/Dockerfile @@ -1,6 +1,6 @@ # Using official python runtime base image FROM schoolofdevops/voteapp-python:v0.1.0 -# + # Set the application directory WORKDIR /app diff --git a/vote/Jenkinsfile b/vote/Jenkinsfile index dd30b8eaf4..0a0a4dc98a 100644 --- a/vote/Jenkinsfile +++ b/vote/Jenkinsfile @@ -2,8 +2,8 @@ pipeline { agent{ docker{ - image 'python' - args '-v $HOME/.m2:/root/.m2' } + image 'python:2.7.16-slim' + } } stages{ @@ -17,7 +17,7 @@ pipeline { steps{ echo 'building vote app' dir('vote'){ - sh 'pip install -i requirements.txt' + sh 'pip install -r requirements.txt' } } } From b5b7e948dfcbb54ee36386875255a5c10dcde688 Mon Sep 17 00:00:00 2001 From: armando caprini Date: Thu, 13 Aug 2020 15:55:16 +0200 Subject: [PATCH 27/31] changed Jenkinsfile --- vote/Jenkinsfile | 1 + vote/tests/test_frontend.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/vote/Jenkinsfile b/vote/Jenkinsfile index 0a0a4dc98a..8c73af0335 100644 --- a/vote/Jenkinsfile +++ b/vote/Jenkinsfile @@ -3,6 +3,7 @@ pipeline { agent{ docker{ image 'python:2.7.16-slim' + args '--user root' } } diff --git a/vote/tests/test_frontend.py b/vote/tests/test_frontend.py index 5e3d37a3d1..1171e29d7f 100644 --- a/vote/tests/test_frontend.py +++ b/vote/tests/test_frontend.py @@ -10,7 +10,6 @@ def setUp(self): self.app = app.test_client() self.app.testing = True - def test_home_status_code(self): """Assert that the home page loads successfully""" result = self.app.get('/') From 744ec6c30e36add11063ecf6c14a8b05699aa77d Mon Sep 17 00:00:00 2001 From: neo-acap <68500599+neo-acap@users.noreply.github.com> Date: Thu, 3 Feb 2022 14:12:15 +0100 Subject: [PATCH 28/31] Added Jenkinsfile --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..738bce77a1 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,11 @@ +pipeline { + agent any + stages { + stage('builkd') { + steps { + validateDeclarativePipeline '/vote' + } + } + + } +} \ No newline at end of file From 26d144f0288d46b52813051e27a293d6cd382284 Mon Sep 17 00:00:00 2001 From: neo-acap <68500599+neo-acap@users.noreply.github.com> Date: Thu, 3 Feb 2022 14:36:13 +0100 Subject: [PATCH 29/31] Update app.py --- vote/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vote/app.py b/vote/app.py index db5ff2e4d8..82ac538bd4 100644 --- a/vote/app.py +++ b/vote/app.py @@ -8,7 +8,7 @@ option_a = os.getenv('OPTION_A', "Emacs") option_b = os.getenv('OPTION_B', "Vi") hostname = socket.gethostname() -version = 'v1' +version = 'v2' app = Flask(__name__) From 6805fd3dad9e35c0c667881fccad52992706bd9b Mon Sep 17 00:00:00 2001 From: neo-acap <68500599+neo-acap@users.noreply.github.com> Date: Thu, 3 Feb 2022 14:48:58 +0100 Subject: [PATCH 30/31] Added Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 738bce77a1..2f2e46e352 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { stages { stage('builkd') { steps { - validateDeclarativePipeline '/vote' + validateDeclarativePipeline '/vote/Jenkinsfile' } } From 3b479a50295a8062fd3b09157d3142a328d8033c Mon Sep 17 00:00:00 2001 From: neo-acap <68500599+neo-acap@users.noreply.github.com> Date: Thu, 3 Feb 2022 15:13:43 +0100 Subject: [PATCH 31/31] Update Jenkinsfile --- Jenkinsfile | 51 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2f2e46e352..8c73af0335 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,48 @@ pipeline { - agent any - stages { - stage('builkd') { - steps { - validateDeclarativePipeline '/vote/Jenkinsfile' + + agent{ + docker{ + image 'python:2.7.16-slim' + args '--user root' } } - } -} \ No newline at end of file + stages{ + + stage("build"){ + + when{ + changeset "**/vote/**" + } + + steps{ + echo 'building vote app' + dir('vote'){ + sh 'pip install -r requirements.txt' + } + } + } + + stage("test"){ + + when{ + changeset "**/vote/**" + } + + steps{ + echo 'Running Unit Tets on result app' + dir('vote'){ + sh 'nosetests -v' + } + } + } + + + } + + post{ + always{ + echo 'Fatto tutto pip. Benbrai..' + } + } +}