Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Jenkinsfile) minor optimization of the withEnv steps #2033

Merged
merged 1 commit into from
May 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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