Skip to content

Commit

Permalink
Merge pull request #253 from jglick/ci
Browse files Browse the repository at this point in the history
CI improvements
  • Loading branch information
jglick authored Nov 22, 2019
2 parents dfeb2ad + 02bafb0 commit 7cceadf
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 36 deletions.
33 changes: 8 additions & 25 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
pipeline {
options {
buildDiscarder(logRotator(numToKeepStr: '20'))
timeout(time: 1, unit: 'HOURS')
}
agent {
// TODO convert as in https://github.com/jenkinsci/archetypes/pull/44
// (Archiving of build.log would be tricky; maybe just pass -Dinvoker.streamLogs instead.)
docker {
image 'maven:3.6.1-jdk-8'
label 'docker'
}
}
stages {
stage('main') {
steps {
// TODO -s settings-azure.xml
sh 'mvn -B --no-transfer-progress -Prun-plugin-pom-its clean verify'
}
post {
failure {
catchError { // JENKINS-42478: in case the failure occurred prior to getting the node
archiveArtifacts artifacts: 'target/its/*/build.log', allowEmptyArchive: true
}
}
properties([buildDiscarder(logRotator(numToKeepStr: '20'))])
node('maven') {
checkout scm
timeout(time: 1, unit: 'HOURS') {
// TODO Azure mirror
ansiColor('xterm') {
withEnv(['MAVEN_OPTS=-Djansi.force=true']) {
sh 'mvn -B -Dstyle.color=always -ntp -Prun-plugin-pom-its clean verify'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@
<goal>run</goal>
</goals>
<configuration>
<streamLogs>false</streamLogs>
<streamLogs>true</streamLogs>
<showErrors>true</showErrors>
<cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
<localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
Expand Down
2 changes: 1 addition & 1 deletion src/it/benchmark/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=-Dbenchmark clean test
invoker.goals=-Dstyle.color=always -ntp -Dbenchmark clean test
2 changes: 1 addition & 1 deletion src/it/beta-fail/invoker.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
invoker.goals=clean install
invoker.goals=-Dstyle.color=always -ntp clean install
invoker.buildResult=failure
2 changes: 1 addition & 1 deletion src/it/beta-fail/postbuild.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
assert new File(basedir, 'build.log').text.contains('[ERROR] downstream/Caller:5 upstream/Api.experimental()V is still in beta')
assert new File(basedir, 'build.log').text.replaceAll(/\e\[[\d;]*[^\d;]/, '').contains('[ERROR] downstream/Caller:5 upstream/Api.experimental()V is still in beta')

return true
2 changes: 1 addition & 1 deletion src/it/beta-just-testing/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=clean install
invoker.goals=-Dstyle.color=always -ntp clean install
2 changes: 1 addition & 1 deletion src/it/beta-pass/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals=clean install
invoker.goals=-Dstyle.color=always -ntp clean install
4 changes: 2 additions & 2 deletions src/it/incrementals-and-plugin-bom/invoker.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
invoker.goals.1=clean install
invoker.goals.1=-Dstyle.color=always -ntp clean install
# real extension will not work here due to its not being at the root of a repository, so fake it:
invoker.goals.2=-Dset.changelist -Dchangelist=-rc1234.deadbeef5678 clean install
invoker.goals.2=-Dstyle.color=always -ntp -Dset.changelist -Dchangelist=-rc1234.deadbeef5678 clean install
2 changes: 1 addition & 1 deletion src/it/sample-plugin/invoker.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# install, not verify, because we want to check the artifact as we would be about to deploy it
# release.skipTests normally set in jenkins-release profile since release:perform would do the tests
invoker.goals=-Pjenkins-release -Drelease.skipTests=false clean install
invoker.goals=-Dstyle.color=always -ntp -Pjenkins-release -Drelease.skipTests=false clean install
2 changes: 1 addition & 1 deletion src/it/undefined-java-level/invoker.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
invoker.goals=clean install
invoker.goals=-Dstyle.color=always -ntp clean install
invoker.buildResult=failure
2 changes: 1 addition & 1 deletion src/it/undefined-java-level/postbuild.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
assert new File(basedir, 'build.log').text.contains('java.lang.IllegalArgumentException: Unknown JDK version given. Should be something like "1.7"')
assert new File(basedir, 'build.log').text.replaceAll(/\e\[[\d;]*[^\d;]/, '').contains('java.lang.IllegalArgumentException: Unknown JDK version given. Should be something like "1.7"')

return true

0 comments on commit 7cceadf

Please sign in to comment.