From fc610927344c48c055afb8cfd9d88aa970b5251a Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 2 Mar 2018 23:43:02 +0000 Subject: [PATCH 01/18] version: set to 0.5.0 --- CHANGELOG | 1 - pom.xml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0f7e0ad..7c7c673 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,7 +9,6 @@ CHANGELOG * Add `BeanBuilder` experiment * Upgrade `lombok` to 1.16.20 * Upgrade assertj to 3.9.1 -* jenkins: test on both java 8 and 9 0.4.0 ----- diff --git a/pom.xml b/pom.xml index 383e4de..912869d 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ mon - 0.5.0-SNAPSHOT + 0.5.0 1.8 From 6c52720843843ff38e9d60cee873f9ab92914035 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 07:47:12 +0000 Subject: [PATCH 02/18] version: set to 0.6.0-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 912869d..7febbd4 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ mon - 0.5.0 + 0.6.0-SNAPSHOT 1.8 From 4bb3819935162b36d4517dbaffa1726a71ca7f0c Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 08:34:56 +0000 Subject: [PATCH 03/18] pom: fix accidental merge of SNAPSHOT into master --- CHANGELOG | 5 +++++ pom.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7c7c673..b5e231b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ CHANGELOG ========= +0.5.1 +----- + +* Fix accidental merge with SNAPSHOT version in to master + 0.5.0 ----- diff --git a/pom.xml b/pom.xml index 7febbd4..92dfb5e 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ mon - 0.6.0-SNAPSHOT + 0.5.1 1.8 From 463d633ed91e253b667ee5a5e48a98f942f3e766 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 08:36:53 +0000 Subject: [PATCH 04/18] version set to 0.6.0-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 92dfb5e..7febbd4 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ mon - 0.5.1 + 0.6.0-SNAPSHOT 1.8 From e6e022381c4e12747cabcce607ed2034f28a4159 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 08:46:47 +0000 Subject: [PATCH 05/18] jenkins: add check to fail build when SNAPSHOT on master branch --- Jenkinsfile.groovy | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 3f87b24..d66f124 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -9,6 +9,16 @@ pipeline { git url: gitRepoUrl, branch: '**', credentialsId: 'github-kemitix' } } + stage('no SNAPSHOT in master') { + // checks that the pom version is not a snapshot when the current branch is master + when { expression (env.GIT_BRANCH == 'master') } + steps { + def pom = readMavenPom file: 'pom.xml' + if ((pom.version).contains("SNAPSHOT")) { + error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") + } + } + } stage('Build') { parallel { stage('Java 8') { From 4a1311b2141ce1f6cf7e9b1ab4235a0938509d18 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 08:49:29 +0000 Subject: [PATCH 06/18] Revert "version set to 0.6.0-SNAPSHOT" This reverts commit 463d633ed91e253b667ee5a5e48a98f942f3e766. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7febbd4..92dfb5e 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ mon - 0.6.0-SNAPSHOT + 0.5.1 1.8 From b2eda3252aab6b4231799633763ace5a428583c4 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 08:53:41 +0000 Subject: [PATCH 07/18] jenkins: fix syntax --- Jenkinsfile.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index d66f124..d272c7c 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,5 +1,6 @@ final String gitRepoUrl = 'git@github.com:kemitix/mon.git' final String mvn = "mvn --batch-mode --update-snapshots" +def pom = readMavenPom file: 'pom.xml' pipeline { agent any @@ -11,9 +12,8 @@ pipeline { } stage('no SNAPSHOT in master') { // checks that the pom version is not a snapshot when the current branch is master - when { expression (env.GIT_BRANCH == 'master') } + when { expression { (env.GIT_BRANCH == 'master') } } steps { - def pom = readMavenPom file: 'pom.xml' if ((pom.version).contains("SNAPSHOT")) { error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") } From 2d74af9c8538975a397e7cc5945a61b725ca8f79 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 08:53:41 +0000 Subject: [PATCH 08/18] jenkins: fix syntax --- Jenkinsfile.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index d66f124..d272c7c 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,5 +1,6 @@ final String gitRepoUrl = 'git@github.com:kemitix/mon.git' final String mvn = "mvn --batch-mode --update-snapshots" +def pom = readMavenPom file: 'pom.xml' pipeline { agent any @@ -11,9 +12,8 @@ pipeline { } stage('no SNAPSHOT in master') { // checks that the pom version is not a snapshot when the current branch is master - when { expression (env.GIT_BRANCH == 'master') } + when { expression { (env.GIT_BRANCH == 'master') } } steps { - def pom = readMavenPom file: 'pom.xml' if ((pom.version).contains("SNAPSHOT")) { error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") } From ba64654097c2f23ad9a1a28971c414c3c1363e97 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 09:03:35 +0000 Subject: [PATCH 09/18] jenkins: fix syntax #2 --- Jenkinsfile.groovy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index d272c7c..8d193dd 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -12,11 +12,14 @@ pipeline { } stage('no SNAPSHOT in master') { // checks that the pom version is not a snapshot when the current branch is master - when { expression { (env.GIT_BRANCH == 'master') } } + // TODO: also check for SNAPSHOT when is a pull request with master as the target branch + when { + expression { + (env.GIT_BRANCH == 'master') && + (pom.version).contains("SNAPSHOT") } + } steps { - if ((pom.version).contains("SNAPSHOT")) { - error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") - } + error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") } } stage('Build') { From c074b6e549f17537651b940a5ebc4f93f3e87684 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 09:03:35 +0000 Subject: [PATCH 10/18] jenkins: fix syntax #2 --- Jenkinsfile.groovy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index d272c7c..8d193dd 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -12,11 +12,14 @@ pipeline { } stage('no SNAPSHOT in master') { // checks that the pom version is not a snapshot when the current branch is master - when { expression { (env.GIT_BRANCH == 'master') } } + // TODO: also check for SNAPSHOT when is a pull request with master as the target branch + when { + expression { + (env.GIT_BRANCH == 'master') && + (pom.version).contains("SNAPSHOT") } + } steps { - if ((pom.version).contains("SNAPSHOT")) { - error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") - } + error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") } } stage('Build') { From 5a73f5d7ae3dc8591e3fdde3197bff1476bf1ec2 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 09:22:28 +0000 Subject: [PATCH 11/18] jenkins: strong type read pom --- Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 8d193dd..45684a5 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,6 +1,6 @@ final String gitRepoUrl = 'git@github.com:kemitix/mon.git' final String mvn = "mvn --batch-mode --update-snapshots" -def pom = readMavenPom file: 'pom.xml' +final Model pom = readMavenPom file: 'pom.xml' pipeline { agent any From d6564cef08d333cafa1f3271cbcf62fa8ef2047e Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 09:26:36 +0000 Subject: [PATCH 12/18] jenkins: fix syntax #3 --- Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 45684a5..0ea3cfc 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,6 +1,5 @@ final String gitRepoUrl = 'git@github.com:kemitix/mon.git' final String mvn = "mvn --batch-mode --update-snapshots" -final Model pom = readMavenPom file: 'pom.xml' pipeline { agent any @@ -13,6 +12,7 @@ pipeline { stage('no SNAPSHOT in master') { // checks that the pom version is not a snapshot when the current branch is master // TODO: also check for SNAPSHOT when is a pull request with master as the target branch + final Model pom = readMavenPom file: 'pom.xml' when { expression { (env.GIT_BRANCH == 'master') && From 08e051799d02604578c30e00f39b83d05622ba39 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 11:55:44 +0000 Subject: [PATCH 13/18] jenkins: fix syntax #4 --- Jenkinsfile.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 0ea3cfc..b62191b 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -12,13 +12,13 @@ pipeline { stage('no SNAPSHOT in master') { // checks that the pom version is not a snapshot when the current branch is master // TODO: also check for SNAPSHOT when is a pull request with master as the target branch - final Model pom = readMavenPom file: 'pom.xml' when { expression { (env.GIT_BRANCH == 'master') && - (pom.version).contains("SNAPSHOT") } + (readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT") } } steps { + def pom = readMavenPom(file: 'pom.xml') error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") } } From 88cdd087f125c6be4c700c18c2b672bc7fabc9e7 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 11:59:10 +0000 Subject: [PATCH 14/18] jenkins: fix syntax #5 --- Jenkinsfile.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index b62191b..b9d862b 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -18,8 +18,7 @@ pipeline { (readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT") } } steps { - def pom = readMavenPom(file: 'pom.xml') - error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") + error("Build failed because SNAPSHOT version") } } stage('Build') { From 45c07bab8174d98af35060d7a2ae1e29ea55cf7f Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 12:39:21 +0000 Subject: [PATCH 15/18] jenkins: clean up --- Jenkinsfile.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 45b4a1e..1bfbb04 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,6 +1,5 @@ final String gitRepoUrl = 'git@github.com:kemitix/mon.git' final String mvn = "mvn --batch-mode --update-snapshots" -def pom = readMavenPom file: 'pom.xml' pipeline { agent any From b221695272e0e31ab8c9efdf4f080fb2d4b4d2a1 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 12:41:28 +0000 Subject: [PATCH 16/18] jenkins: use mvn with options --- Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 1bfbb04..2573ec4 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -23,7 +23,7 @@ pipeline { stage('Java 8') { steps { withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') { - sh 'mvn clean install' + sh "${mvn} clean install" } } } From cdd31fe49c1a5f259967b6248dd12a86ee287d6d Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 12:43:37 +0000 Subject: [PATCH 17/18] version set to 0.6.0-SNAPSHOT (again) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 92dfb5e..7febbd4 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ mon - 0.5.1 + 0.6.0-SNAPSHOT 1.8 From 352b3d1473fa76606731f754e8c168f0c23ae653 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 3 Mar 2018 12:47:49 +0000 Subject: [PATCH 18/18] Add missing error when snapshot --- Jenkinsfile.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 2573ec4..9eb564f 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -17,6 +17,9 @@ pipeline { (env.GIT_BRANCH == 'master') && (readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT") } } + steps { + error("Build failed because SNAPSHOT version") + } } stage('Build') { parallel {