Retry build on agent error
@@ -29,6 +29,7 @@ for (i = 0; i < buildTypes.size(); i++) {
if (buildType == 'Windows') {
agentContainerLabel += '-windows'
}
+ retry(conditions: [kubernetesAgent(handleNonKubernetes: true), nonresumable()], count: 2) {
node(agentContainerLabel) {
// First stage is actually checking out the source. Since we're using Multibranch
// currently, we can use "checkout scm".
@@ -59,20 +60,17 @@ for (i = 0; i < buildTypes.size(); i++) {
'clean',
'install',
]
- try {
infra.runMaven(mavenOptions, jdk)
if (isUnix()) {
sh 'git add . && git diff --exit-code HEAD'
}
- } finally {
- archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/surefire-reports/*.dumpstream'
- }
}
}
}
// Once we've built, archive the artifacts and the test results.
stage("${buildType} Publishing") {
+ archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/surefire-reports/*.dumpstream'
if (!fileExists('core/target/surefire-reports/TEST-jenkins.Junit4TestsRanTest.xml')) {
error 'JUnit 4 tests are no longer being run for the core package'
}
@@ -146,8 +144,10 @@ for (i = 0; i < buildTypes.size(); i++) {
}
}
}
+}
builds.ath = {
+ retry(conditions: [agent(), nonresumable()], count: 2) {
node('docker-highmem') {
// Just to be safe
deleteDir()
@@ -174,6 +174,7 @@ builds.ath = {
}
}
}
+}
builds.failFast = failFast
parallel builds
