From 9703dddbbcb657bb0bf99629df3c32335ef1f586 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 17:01:20 +0000 Subject: [PATCH 01/27] Simplify Jenkins checkout --- Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2d06154..f8c4590 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,9 +6,7 @@ pipeline { checkout([ $class: 'GitSCM', branches: [[name: '**']], - doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], - submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'github-kemitix', url: 'git@github.com:kemitix/conditional.git']] ]) sh './mvnw clean install' From dec715a5cba532fc4e56529c7c8b22d4746d64f8 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 18:36:28 +0000 Subject: [PATCH 02/27] Upgrade kemitix-parent to 5.0.3 --- CHANGELOG | 6 ++++++ pom.xml | 43 ++++++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index accb642..bdec8c3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,12 @@ CHANGELOG ========= +0.4.0 +----- + +* Building with Jenkins +* Upgrade `kemitix-parent` to 5.0.3 + 0.3.0 ----- diff --git a/pom.xml b/pom.xml index 6ab918b..27cd5b1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,8 +4,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 3.2.0 - 5-complexity + 1.8 + 4.0.1 + 5-complexity 1 1 0 @@ -14,18 +15,27 @@ 4.12 3.8.0 4.3.0 + 2.10 + 0.4.1 + 1.16.20 - net.kemitix + net.kemitix kemitix-parent - 3.2.0 + 5.0.3 conditional 0.3.0-SNAPSHOT + + org.projectlombok + lombok + ${lombok.version} + true + junit junit @@ -43,25 +53,16 @@ - net.kemitix - kemitix-checkstyle-ruleset-maven-plugin - ${kemitix-checkstyle-ruleset.version} + io.repaint.maven + tiles-maven-plugin + ${tiles-maven-plugin.version} + true - ${kemitix-checkstyle-ruleset.level} + + net.kemitix.tiles:all:${kemitix-tiles.version} + net.kemitix.checkstyle:tile:${kemitix-checkstyle.version} + - - - validate - - check - - - - - - org.eluder.coveralls - coveralls-maven-plugin - ${coveralls-maven-plugin.version} From 78e7cff5f5be5aa170d76ad54fa37e8d68e2aeaf Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 18:50:56 +0000 Subject: [PATCH 03/27] Add jenkins stages for coverage and deployment --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index f8c4590..5dc041d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,5 +14,16 @@ pipeline { archiveArtifacts '**/target/*.jar' } } + stage('Publish Coverage') { + steps { + sh './mvnw test jacoco:report coveralls:report' + sh 'bash <(curl -s https://codecov.io/bash)' + } + } + stage('Deploy') { + steps { + sh './mvnw -Dskip-Tests=true -P release -B deploy' + } + } } } From ff3ab06d9089b59b0d8c3e3b9bb43ac20b66f304 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 19:14:40 +0000 Subject: [PATCH 04/27] Publish Codecov first to check if that works okay --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5dc041d..ddc41ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,8 +16,8 @@ pipeline { } stage('Publish Coverage') { steps { - sh './mvnw test jacoco:report coveralls:report' sh 'bash <(curl -s https://codecov.io/bash)' + sh './mvnw test jacoco:report coveralls:report' } } stage('Deploy') { From 7d9f3aebae15a8f3a388cd310dac09f7f5dc9ed8 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 19:20:49 +0000 Subject: [PATCH 05/27] Use jenkins version for codecov --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ddc41ab..06a19f5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Publish Coverage') { steps { - sh 'bash <(curl -s https://codecov.io/bash)' + sh 'curl -s https://codecov.io/bash | bash -s' sh './mvnw test jacoco:report coveralls:report' } } From c6e19005ff3cbc622f1f83db9a074b62a7824f0e Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 19:25:45 +0000 Subject: [PATCH 06/27] Prevent Codecov from breaking the build --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 06a19f5..7444576 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Publish Coverage') { steps { - sh 'curl -s https://codecov.io/bash | bash -s' + sh 'curl -s https://codecov.io/bash | bash -s || echo "Codecov did not collect coverage reports"' sh './mvnw test jacoco:report coveralls:report' } } From 9cccc396bea99392d81907a91db15431dfc8c593 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 19:44:55 +0000 Subject: [PATCH 07/27] Add CODECOV_REPO_TOKEN --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7444576..29c1f92 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Publish Coverage') { steps { - sh 'curl -s https://codecov.io/bash | bash -s || echo "Codecov did not collect coverage reports"' + sh 'curl -s https://codecov.io/bash | bash -s - -t ${CODECOV_REPO_TOKEN} || echo "Codecov did not collect coverage reports"' sh './mvnw test jacoco:report coveralls:report' } } From ec7ef90268504cf3e60497c8f413a48c68f3980f Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 20:02:17 +0000 Subject: [PATCH 08/27] Remove public coverage services --- Jenkinsfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 29c1f92..2bdcaa8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,12 +14,6 @@ pipeline { archiveArtifacts '**/target/*.jar' } } - stage('Publish Coverage') { - steps { - sh 'curl -s https://codecov.io/bash | bash -s - -t ${CODECOV_REPO_TOKEN} || echo "Codecov did not collect coverage reports"' - sh './mvnw test jacoco:report coveralls:report' - } - } stage('Deploy') { steps { sh './mvnw -Dskip-Tests=true -P release -B deploy' From 9e42c6dd4f4f3cf4bd9dbf942f5485a5b80cd247 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 20:09:49 +0000 Subject: [PATCH 09/27] Fix Inappropriate ioctl error --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2bdcaa8..0426d2d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Deploy') { steps { - sh './mvnw -Dskip-Tests=true -P release -B deploy' + sh 'export GPG_TTY=$(tty) ./mvnw -Dskip-Tests=true -P release -B deploy' } } } From 5e13e71a6838fdd032f8f526985edb05db76f9ee Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 20:11:23 +0000 Subject: [PATCH 10/27] Fix space in 'not a tty' error --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0426d2d..849cb09 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Deploy') { steps { - sh 'export GPG_TTY=$(tty) ./mvnw -Dskip-Tests=true -P release -B deploy' + sh 'export GPG_TTY="$(tty)" ./mvnw -Dskip-Tests=true -P release -B deploy' } } } From 5c809216b8acb70e770b1a1207be519c7a7d8cbe Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 20:12:44 +0000 Subject: [PATCH 11/27] Remove export --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 849cb09..ecdda66 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Deploy') { steps { - sh 'export GPG_TTY="$(tty)" ./mvnw -Dskip-Tests=true -P release -B deploy' + sh 'GPG_TTY="$(tty)" ./mvnw -Dskip-Tests=true -P release -B deploy' } } } From bb0ea1ed8518b1f8fa3265aa78c37b1e5ffecd5f Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 20:30:43 +0000 Subject: [PATCH 12/27] Experimentally disable gpg pinentry --- pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pom.xml b/pom.xml index 27cd5b1..1881fa1 100644 --- a/pom.xml +++ b/pom.xml @@ -64,6 +64,16 @@ + + org.apache.maven.plugins + maven-gpg-plugin + + + --pinentry-mode + loopback + + + From 8e5b936934caf97bee54659c0549ecd2900618d6 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 20:33:57 +0000 Subject: [PATCH 13/27] Revert GPG_TTY --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ecdda66..2bdcaa8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Deploy') { steps { - sh 'GPG_TTY="$(tty)" ./mvnw -Dskip-Tests=true -P release -B deploy' + sh './mvnw -Dskip-Tests=true -P release -B deploy' } } } From 541c53099a8d1cb6e35ca998a648525157bec640 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 23 Feb 2018 21:10:48 +0000 Subject: [PATCH 14/27] try using pgp-maven-plugin to sign --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2bdcaa8..6ef3368 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Deploy') { steps { - sh './mvnw -Dskip-Tests=true -P release -B deploy' + sh './mvnw -Dskip-Tests=true -P release -B org.kohsuke:pgp-maven-plugin:sign' } } } From c8a128a1dd39c0327596b90d3a096556d30d3883 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 07:15:17 +0000 Subject: [PATCH 15/27] Specify signing key --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6ef3368..6888927 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Deploy') { steps { - sh './mvnw -Dskip-Tests=true -P release -B org.kohsuke:pgp-maven-plugin:sign' + sh './mvnw -Dskip-Tests=true -P release -B org.kohsuke:pgp-maven-plugin:sign -Dpgp.secretkey=6F626C45D8B32894' } } } From 90d250fbf8346795d50ac23b3218f1b9a38ab545 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 07:21:21 +0000 Subject: [PATCH 16/27] Specify signing key with scheme prefix --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6888927..90e0d4a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Deploy') { steps { - sh './mvnw -Dskip-Tests=true -P release -B org.kohsuke:pgp-maven-plugin:sign -Dpgp.secretkey=6F626C45D8B32894' + sh './mvnw -Dskip-Tests=true -P release -B org.kohsuke:pgp-maven-plugin:sign -Dpgp.secretkey=keyring:id=6F626C45D8B32894' } } } From 5d8979f834781713f9fd2907453e8a68ac6aeeb6 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 07:35:45 +0000 Subject: [PATCH 17/27] Remove key id --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 90e0d4a..6ef3368 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Deploy') { steps { - sh './mvnw -Dskip-Tests=true -P release -B org.kohsuke:pgp-maven-plugin:sign -Dpgp.secretkey=keyring:id=6F626C45D8B32894' + sh './mvnw -Dskip-Tests=true -P release -B org.kohsuke:pgp-maven-plugin:sign' } } } From ca0731ee75572ac1963572ecf49b66bfc77c6830 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 09:28:15 +0000 Subject: [PATCH 18/27] Revert to using deploy --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6ef3368..2bdcaa8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { } stage('Deploy') { steps { - sh './mvnw -Dskip-Tests=true -P release -B org.kohsuke:pgp-maven-plugin:sign' + sh './mvnw -Dskip-Tests=true -P release -B deploy' } } } From 0ef291ca6a3df6ca0349f546f323c109b9ab3294 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 18:59:13 +0000 Subject: [PATCH 19/27] Remove custom maven-gpg-plugin --- pom.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pom.xml b/pom.xml index 1881fa1..27cd5b1 100644 --- a/pom.xml +++ b/pom.xml @@ -64,16 +64,6 @@ - - org.apache.maven.plugins - maven-gpg-plugin - - - --pinentry-mode - loopback - - - From 67185acc6651fec9a0b067b684265529178cc7c9 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 20:00:34 +0000 Subject: [PATCH 20/27] Upgrade kemitix-maven-tiles to 0.5.0-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 27cd5b1..049dd64 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ 3.8.0 4.3.0 2.10 - 0.4.1 + 0.5.0-SNAPSHOT 1.16.20 From 41fa2bcbe5a9e7de469f5071a625a2fa0727dcca Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 20:38:46 +0000 Subject: [PATCH 21/27] Upgrade kemitix-maven-tiles to 0.5.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 049dd64..4ffee2b 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ 3.8.0 4.3.0 2.10 - 0.5.0-SNAPSHOT + 0.5.0 1.16.20 From ffdc554c602405f91458d9f2dc29218b43b84153 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 20:39:51 +0000 Subject: [PATCH 22/27] jenkins: ensure batch mode and always update snapshots --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2bdcaa8..5a3b95a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,14 +9,14 @@ pipeline { extensions: [[$class: 'CleanBeforeCheckout']], userRemoteConfigs: [[credentialsId: 'github-kemitix', url: 'git@github.com:kemitix/conditional.git']] ]) - sh './mvnw clean install' + sh './mvnw -B -U clean install' junit '**/target/surefire-reports/*.xml' archiveArtifacts '**/target/*.jar' } } stage('Deploy') { steps { - sh './mvnw -Dskip-Tests=true -P release -B deploy' + sh './mvnw -B -Dskip-Tests=true -P release deploy' } } } From 96782dc30383dbea26c47a6004717a6df70332f5 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 20:45:38 +0000 Subject: [PATCH 23/27] Only deploy when on master branch --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5a3b95a..ca52d98 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,6 +15,11 @@ pipeline { } } stage('Deploy') { + when { + expression { + env.GIT_BRANCH === 'master' + } + } steps { sh './mvnw -B -Dskip-Tests=true -P release deploy' } From e85657f8b42d3b30e94a830032c63a1f98a530da Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 20:47:10 +0000 Subject: [PATCH 24/27] Only deploy when on master branch (fix syntax) --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ca52d98..b0f4760 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { stage('Deploy') { when { expression { - env.GIT_BRANCH === 'master' + env.GIT_BRANCH == 'master' } } steps { From 3cf89ab11cdb8481c2bc0843c733624aed65d2af Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 20:50:21 +0000 Subject: [PATCH 25/27] Split Build stage up --- Jenkinsfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b0f4760..880b2ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent any stages { - stage('Build') { + stage('Prepare') { steps { checkout([ $class: 'GitSCM', @@ -9,7 +9,15 @@ pipeline { extensions: [[$class: 'CleanBeforeCheckout']], userRemoteConfigs: [[credentialsId: 'github-kemitix', url: 'git@github.com:kemitix/conditional.git']] ]) + } + } + stage('Build') { + steps { sh './mvnw -B -U clean install' + } + } + stage('Reporting') { + steps { junit '**/target/surefire-reports/*.xml' archiveArtifacts '**/target/*.jar' } From 03d6860775ea3bf32e40be8ac4f3d92b2df742ea Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 21:32:47 +0000 Subject: [PATCH 26/27] Upgrade kemitix-maven-tiles to 0.5.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4ffee2b..aa6a6f5 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ 3.8.0 4.3.0 2.10 - 0.5.0 + 0.5.1 1.16.20 From 065c366c6893cd2d5b7f40b10fa98cd03ef86d0f Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 24 Feb 2018 22:02:13 +0000 Subject: [PATCH 27/27] travis: batch mode and update snapshots --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0d1d54a..ea42614 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ cache: directories: - "$HOME/.m2" install: true -script: "./mvnw clean install" +script: "./mvnw -B -U clean install" after_success: - sh .travis-support/coveralls.sh - bash <(curl -s https://codecov.io/bash)