This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jenkins-lib.git
The following commit(s) were added to refs/heads/master by this push:
new e6da3ae Revert "don't pick up tmpWs from a context"
e6da3ae is described below
commit e6da3aef33c2a8833ec79f049584048b21cf461b
Author: rfscholte <[email protected]>
AuthorDate: Sat Sep 26 11:49:07 2020 +0200
Revert "don't pick up tmpWs from a context"
This reverts commit 87c2c5f5735f13b7eec62f8cd0cf4fbbbb63dd88.
Revert "fix }"
This reverts commit 97e79eb867e8a731880e5c6c2e01f77505cffc3c.
Revert "introduce optional tmpWs for Windows to prevent long path failures"
This reverts commit f936616c399eb35d9e65f32d5ab7b24955b2fe91.
---
vars/asfMavenTlpStdBuild.groovy | 117 +++++++++++++++++++---------------------
1 file changed, 55 insertions(+), 62 deletions(-)
diff --git a/vars/asfMavenTlpStdBuild.groovy b/vars/asfMavenTlpStdBuild.groovy
index 18257f8..ac3ce61 100644
--- a/vars/asfMavenTlpStdBuild.groovy
+++ b/vars/asfMavenTlpStdBuild.groovy
@@ -33,13 +33,12 @@ def call(Map params = [:]) {
// now determine the matrix of parallel builds
def oses = params.containsKey('os') ? params.os : ['linux', 'windows']
- // minimum, LTS, current and next ea
+ // minimum, LTS, current and next ea
def jdks = params.containsKey('jdks') ? params.jdks :
params.containsKey('jdk') ? params.jdk : ['7','8','11']
//['7','8','11','14','15']
def maven = params.containsKey('maven') ? params.maven : '3.x.x'
// def failFast = params.containsKey('failFast') ? params.failFast : true
// Just temporarily
def failFast = false;
- def tmpWs = params.containsKey('tmpWs') ? params.tmpWs : false
Map tasks = [failFast: failFast]
boolean first = true
for (String os in oses) {
@@ -76,38 +75,33 @@ def call(Map params = [:]) {
String stageId = "${os}-jdk${jdk}"
tasks[stageId] = {
node("${label}") {
- def wsDir = pwd()
- if (os == 'windows' && tmpWs) {
- wsDir = 'F:\\short\\' +
"$BUILD_TAG".replaceAll(/(.+)maven-box_maven-(.+)/) { "m-${it[2]}" }
+ stage("Checkout ${stageId}") {
+ echo "NODE_NAME = ${env.NODE_NAME}"
+ try {
+ dir('m') {
+ checkout scm
+ }
+ } catch (Throwable e) {
+ // First step to keep the workspace clean and safe disk space
+ cleanWs()
+ if (!failFast) {
+ throw e
+ } else if (failingFast == null) {
+ failingFast = stageId
+ echo "[FAIL FAST] This is the first failure and likely root
cause"
+ throw e
+ } else {
+ echo "[FAIL FAST] ${failingFast} had first failure, ignoring
${e.message}"
+ }
+ }
}
- ws( dir : "$wsDir" )
- stage("Checkout ${stageId}") {
- echo "NODE_NAME = ${env.NODE_NAME}"
- try {
- dir('m') {
- checkout scm
- }
- } catch (Throwable e) {
- // First step to keep the workspace clean and safe disk space
- cleanWs()
- if (!failFast) {
- throw e
- } else if (failingFast == null) {
- failingFast = stageId
- echo "[FAIL FAST] This is the first failure and likely
root cause"
- throw e
- } else {
- echo "[FAIL FAST] ${failingFast} had first failure,
ignoring ${e.message}"
- }
- }
- }
- stage("Build ${stageId}") {
- if (failingFast != null) {
- cleanWs()
- echo "[FAIL FAST] ${failingFast} has failed. Skipping
${stageId}."
- } else try {
- // mavenSettingsConfig: 'simple-deploy-settings-no-mirror',
- withMaven(jdk:jdkName, maven:mvnName,
mavenLocalRepo:'.repository',
+ stage("Build ${stageId}") {
+ if (failingFast != null) {
+ cleanWs()
+ echo "[FAIL FAST] ${failingFast} has failed. Skipping
${stageId}."
+ } else try {
+ // mavenSettingsConfig: 'simple-deploy-settings-no-mirror',
+ withMaven(jdk:jdkName, maven:mvnName,
mavenLocalRepo:'.repository',
options: [
artifactsPublisher(disabled: disablePublishers),
junitPublisher(ignoreAttachments: false),
@@ -117,41 +111,40 @@ def call(Map params = [:]) {
// DISABLED DUE TO INFRA-17514 invokerPublisher(),
pipelineGraphPublisher(disabled: disablePublishers)
], publisherStrategy: 'EXPLICIT') {
- dir ('m') {
- if (isUnix()) {
- sh cmd.join(' ')
- } else {
- bat cmd.join(' ')
- }
+ dir ('m') {
+ if (isUnix()) {
+ sh cmd.join(' ')
+ } else {
+ bat cmd.join(' ')
}
}
- } catch (Throwable e) {
- echo "[FAILURE-004] ${e}"
- // First step to keep the workspace clean and safe disk space
- cleanWs()
- if (!failFast) {
- throw e
- } else if (failingFast == null) {
- failingFast = stageId
- echo "[FAIL FAST] This is the first failure and likely
root cause"
- throw e
- } else {
- echo "[FAIL FAST] ${failingFast} had first failure,
ignoring ${e.message}"
- }
- } finally {
- try {
- cleanWs()
- } catch(IOException e) {
- echo "Failed to clean up workspace: ${e}"
- }
}
- }
+ } catch (Throwable e) {
+ echo "[FAILURE-004] ${e}"
+ // First step to keep the workspace clean and safe disk space
+ cleanWs()
+ if (!failFast) {
+ throw e
+ } else if (failingFast == null) {
+ failingFast = stageId
+ echo "[FAIL FAST] This is the first failure and likely root
cause"
+ throw e
+ } else {
+ echo "[FAIL FAST] ${failingFast} had first failure, ignoring
${e.message}"
+ }
+ } finally {
+ try {
+ cleanWs()
+ } catch(IOException e) {
+ echo "Failed to clean up workspace: ${e}"
+ }
+ }
}
}
}
}
-
- // run the parallel builds
+ }
+ // run the parallel builds
parallel(tasks)
// JENKINS-34376 seems to make it hard to detect the aborted builds
@@ -186,7 +179,7 @@ def call(Map params = [:]) {
echo "***** FAST FAILURE *****\n\nFast failure triggered by
${failingFast}\n\n***** FAST FAILURE *****"
}
stage("Notifications") {
- jenkinsNotify()
+ jenkinsNotify()
}
}
}