From 5a996e64b9be10a4abf40ff03cc0f2db38e22fdf Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 11 Mar 2018 19:28:31 +0000 Subject: [PATCH 1/8] jenkins: remove circle CI --- circle.yml | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 circle.yml diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 280d970..0000000 --- a/circle.yml +++ /dev/null @@ -1,3 +0,0 @@ -test: - override: - - ./mvnw clean install From 97be57f92e3601ec624a308970bbf3732b5706ee Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 11 Mar 2018 19:31:42 +0000 Subject: [PATCH 2/8] jenkins: remove shippable CI --- shippable.yml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 shippable.yml diff --git a/shippable.yml b/shippable.yml deleted file mode 100644 index 3d074c8..0000000 --- a/shippable.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: java -jdk: -- oraclejdk8 -cache: - directories: - - "$HOME/.m2" -install: true -script: "./mvnw clean install" From 9193c8730b68675f438c3c9af695c7cf8576f9dc Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 11 Mar 2018 19:36:38 +0000 Subject: [PATCH 3/8] jenkins: remove shippable CI --- wercker.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 wercker.yml diff --git a/wercker.yml b/wercker.yml deleted file mode 100644 index b152705..0000000 --- a/wercker.yml +++ /dev/null @@ -1,6 +0,0 @@ -box: maven:3.5.0-jdk-8 - -build: - steps: - - xenoterracide/maven: - goals: clean install From bc7516fd82631dd22579ed26db1a7884403b24e4 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 12 Mar 2018 19:12:49 +0000 Subject: [PATCH 4/8] travis: remove travis support directory --- .travis-support | 1 - 1 file changed, 1 deletion(-) delete mode 160000 .travis-support diff --git a/.travis-support b/.travis-support deleted file mode 160000 index b97def2..0000000 --- a/.travis-support +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b97def251b784ecc8de6d3cc30d2793ac0bd375e From ea5d1e0c4a7e66ce15ea58468fae86dd3e894367 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 18 Apr 2018 20:24:31 +0100 Subject: [PATCH 5/8] Update format --- Jenkinsfile.groovy | 83 ++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 50 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index baea78b..6b4d689 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,18 +1,9 @@ -// non-standard Jenkinsfile -// * only publish code coverage to codacy for builder module -// * only deploy artifacts for ruleset and tile modules - final String mvn = "mvn --batch-mode --update-snapshots" pipeline { agent any stages { - stage('Environment') { - steps { - sh 'set' - } - } - stage('no SNAPSHOT in master') { + stage('master != SNAPSHOT') { // checks that the pom version is not a snapshot when the current or target branch is master when { expression { @@ -24,19 +15,34 @@ pipeline { error("Build failed because SNAPSHOT version") } } - stage('Static Code Analysis') { - when { expression { findFiles(glob: '**/src/main/java/**/*.java').length > 0 } } + stage('Build & Test') { steps { withMaven(maven: 'maven', jdk: 'JDK LTS') { - sh "${mvn} compile" - sh "${mvn} checkstyle:checkstyle" - sh "${mvn} pmd:pmd" + sh "${mvn} clean compile checkstyle:checkstyle pmd:pmd test" + //junit '**/target/surefire-reports/*.xml' + sh "${mvn} -pl builder jacoco:report com.gavinmogan:codacy-maven-plugin:coverage " + + "-DcoverageReportFile=target/site/jacoco/jacoco.xml " + + "-DprojectToken=`$JENKINS_HOME/codacy/token` " + + "-DapiToken=`$JENKINS_HOME/codacy/apitoken` " + + "-Dcommit=`git rev-parse HEAD`" + jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class' pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: '' + step([$class: 'hudson.plugins.checkstyle.CheckStylePublisher', + pattern: '**/target/checkstyle-result.xml', + healthy:'20', + unHealthy:'100']) } } } - stage('SonarQube (develop only)') { - when { expression { env.GIT_BRANCH == 'develop' && env.GIT_URL.startsWith('https://') } } + stage('Verify & Install') { + steps { + withMaven(maven: 'maven', jdk: 'JDK LTS') { + sh "${mvn} -DskipTests install" + } + } + } + stage('SonarQube (github only)') { + when { expression { env.GIT_URL.startsWith('https://github.com') } } steps { withSonarQubeEnv('sonarqube') { withMaven(maven: 'maven', jdk: 'JDK LTS') { @@ -45,47 +51,24 @@ pipeline { } } } - stage('Build Java Next') { - steps { - withMaven(maven: 'maven', jdk: 'JDK Next') { - sh "${mvn} clean install -Djava.version=9 -Dmaven-enforcer-plugin.version=3.0.0-M1" - //TODO: check that git status is still clean - i.e. builder didn't update any rulesets - } - } - } - stage('Build Java LTS') { - steps { - withMaven(maven: 'maven', jdk: 'JDK LTS') { - sh "${mvn} clean install" - //TODO: check that git status is still clean - i.e. builder didn't update any rulesets - } - } - } - stage('Test Results') { - when { expression { findFiles(glob: '**/target/surefire-reports/*.xml').length > 0 } } - steps { - junit '**/target/surefire-reports/*.xml' - jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class' - withMaven(maven: 'maven', jdk: 'JDK LTS') { - sh "${mvn} -pl builder com.gavinmogan:codacy-maven-plugin:coverage " + - "-DcoverageReportFile=target/site/jacoco/jacoco.xml " + - "-DprojectToken=`$JENKINS_HOME/codacy/token` " + - "-DapiToken=`$JENKINS_HOME/codacy/apitoken` " + - "-Dcommit=`git rev-parse HEAD`" - } - } - } stage('Archiving') { when { expression { findFiles(glob: '**/target/*.jar').length > 0 } } steps { archiveArtifacts '**/target/*.jar' } } - stage('Deploy') { - when { expression { (env.GIT_BRANCH == 'master' && env.GIT_URL.startsWith('https://')) } } + stage('Deploy (master on github)') { + when { expression { (env.GIT_BRANCH == 'master' && env.GIT_URL.startsWith('https://github.com')) } } steps { withMaven(maven: 'maven', jdk: 'JDK LTS') { - sh "${mvn} -pl ruleset,tile deploy --activate-profiles release -DskipTests=true" + sh "${mvn} deploy --activate-profiles release -DskipTests=true" + } + } + } + stage('Build Java 9') { + steps { + withMaven(maven: 'maven', jdk: 'JDK 9') { + sh "${mvn} clean verify -Djava.version=9" } } } From 8ef9226a1250a5d3c5550c6b04a3ea89b18605f9 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 18 Apr 2018 20:43:45 +0100 Subject: [PATCH 6/8] Upgrade kemitix-parent to 5.1.0 --- builder/pom.xml | 2 +- regressions/pom.xml | 2 +- ruleset/pom.xml | 2 +- tile/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/builder/pom.xml b/builder/pom.xml index 73d39c3..33b7ee9 100644 --- a/builder/pom.xml +++ b/builder/pom.xml @@ -7,7 +7,7 @@ net.kemitix kemitix-parent - 5.0.3 + 5.1.0 diff --git a/regressions/pom.xml b/regressions/pom.xml index fa3f0bd..4c3feec 100644 --- a/regressions/pom.xml +++ b/regressions/pom.xml @@ -6,7 +6,7 @@ net.kemitix kemitix-parent - 5.0.3 + 5.1.0 diff --git a/ruleset/pom.xml b/ruleset/pom.xml index 591f02d..a7a88e5 100644 --- a/ruleset/pom.xml +++ b/ruleset/pom.xml @@ -7,7 +7,7 @@ net.kemitix kemitix-parent - 5.0.3 + 5.1.0 diff --git a/tile/pom.xml b/tile/pom.xml index f27b587..b692eb5 100644 --- a/tile/pom.xml +++ b/tile/pom.xml @@ -5,7 +5,7 @@ net.kemitix kemitix-parent - 5.0.3 + 5.1.0 4.0.0 From e39dafc62be3b6e88fe0d3fb836118a6487a1575 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 19 Apr 2018 07:20:36 +0100 Subject: [PATCH 7/8] Upgrade kemitix-maven-tiles to 0.8.1 --- builder/pom.xml | 18 +++++++++--------- regressions/pom.xml | 6 +++--- ruleset/pom.xml | 7 +++---- tile/pom.xml | 5 ++--- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/builder/pom.xml b/builder/pom.xml index 33b7ee9..9c3c734 100644 --- a/builder/pom.xml +++ b/builder/pom.xml @@ -20,7 +20,7 @@ true 1.8 2.10 - 0.3.0 + 0.8.1 8.7 1.27.0 @@ -142,14 +142,14 @@ true - net.kemitix.tiles:maven-plugins-tile:${kemitix-tiles.version} - net.kemitix.tiles:enforcer-tile:${kemitix-tiles.version} - net.kemitix.tiles:compiler-tile:${kemitix-tiles.version} - net.kemitix.tiles:huntbugs-tile:${kemitix-tiles.version} - net.kemitix.tiles:pmd-tile:${kemitix-tiles.version} - net.kemitix.tiles:testing-tile:${kemitix-tiles.version} - net.kemitix.tiles:coverage-tile:${kemitix-tiles.version} - net.kemitix.tiles:pitest-tile:${kemitix-tiles.version} + net.kemitix.tiles:maven-plugins:${kemitix-tiles.version} + net.kemitix.tiles:enforcer:${kemitix-tiles.version} + net.kemitix.tiles:compiler:${kemitix-tiles.version} + net.kemitix.tiles:huntbugs:${kemitix-tiles.version} + net.kemitix.tiles:pmd:${kemitix-tiles.version} + net.kemitix.tiles:testing:${kemitix-tiles.version} + net.kemitix.tiles:coverage:${kemitix-tiles.version} + net.kemitix.tiles:pitest:${kemitix-tiles.version} diff --git a/regressions/pom.xml b/regressions/pom.xml index 4c3feec..7f261ed 100644 --- a/regressions/pom.xml +++ b/regressions/pom.xml @@ -17,7 +17,7 @@ true 2.10 - 0.2.0 + 0.8.1 8.7 1.27.0 @@ -50,8 +50,8 @@ true - net.kemitix.tiles:maven-plugins-tile:${kemitix-tiles.version} - net.kemitix.tiles:compiler-tile:${kemitix-tiles.version} + net.kemitix.tiles:maven-plugins:${kemitix-tiles.version} + net.kemitix.tiles:compiler:${kemitix-tiles.version} diff --git a/ruleset/pom.xml b/ruleset/pom.xml index a7a88e5..ca03294 100644 --- a/ruleset/pom.xml +++ b/ruleset/pom.xml @@ -22,7 +22,7 @@ 2.10 - 0.2.0 + 0.8.1 3.0.2 @@ -57,9 +57,8 @@ true - net.kemitix.tiles:maven-plugins-tile:${kemitix-tiles.version} - net.kemitix.tiles:enforcer-tile:${kemitix-tiles.version} - net.kemitix.tiles:release-tile:${kemitix-tiles.version} + net.kemitix.tiles:maven-plugins:${kemitix-tiles.version} + net.kemitix.tiles:enforcer:${kemitix-tiles.version} diff --git a/tile/pom.xml b/tile/pom.xml index b692eb5..0d21a6b 100644 --- a/tile/pom.xml +++ b/tile/pom.xml @@ -18,7 +18,7 @@ 2.10 - 0.2.0 + 0.8.1 @@ -30,8 +30,7 @@ true - net.kemitix.tiles:maven-plugins-tile:${kemitix-tiles.version} - net.kemitix.tiles:release-tile:${kemitix-tiles.version} + net.kemitix.tiles:maven-plugins:${kemitix-tiles.version} From 83a6e0c8a5bcfb7b73d747336e7a58d5ad0194ec Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 19 Apr 2018 20:16:34 +0100 Subject: [PATCH 8/8] regressions: java version set to 1.8 --- regressions/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/regressions/pom.xml b/regressions/pom.xml index 7f261ed..8a18a88 100644 --- a/regressions/pom.xml +++ b/regressions/pom.xml @@ -19,6 +19,7 @@ 2.10 0.8.1 + 1.8 8.7 1.27.0 3.0.0