Skip to content

Commit

Permalink
chore(Jenkinsfile) minor optimization of the withEnv steps (#2033)
Browse files Browse the repository at this point in the history
  • Loading branch information
dduportal committed May 2, 2023
1 parent 6ee6f33 commit 29b6f89
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ def mavenEnv(Map params = [:], Closure body) {
// no Dockerized tests; https://github.com/jenkins-infra/documentation/blob/master/ci.adoc#container-agents
node('maven-bom') {
timeout(120) {
withEnv(["JAVA_HOME=/opt/jdk-$params.jdk"]) {
infra.withArtifactCachingProxy {
withEnv([
"MAVEN_ARGS=${env.MAVEN_ARGS != null ? MAVEN_ARGS : ''} -B -ntp -Dmaven.repo.local=${WORKSPACE_TMP}/m2repo"
]) {
body()
}
}
if (junit(testResults: '**/target/surefire-reports/TEST-*.xml,**/target/failsafe-reports/TEST-*.xml').failCount > 0) {
// TODO JENKINS-27092 throw up UNSTABLE status in this case
error 'Some test failures, not going to continue'
infra.withArtifactCachingProxy {
withEnv([
"JAVA_HOME=/opt/jdk-$params.jdk",
"MAVEN_ARGS=${env.MAVEN_ARGS != null ? MAVEN_ARGS : ''} -B -ntp -Dmaven.repo.local=${WORKSPACE_TMP}/m2repo"
]) {
body()
}
}
if (junit(testResults: '**/target/surefire-reports/TEST-*.xml,**/target/failsafe-reports/TEST-*.xml').failCount > 0) {
// TODO JENKINS-27092 throw up UNSTABLE status in this case
error 'Some test failures, not going to continue'
}
}
}
}
Expand Down

0 comments on commit 29b6f89

Please sign in to comment.