This is an automated email from the ASF dual-hosted git repository. rfscholte pushed a commit to branch MNG-6656 in repository https://gitbox.apache.org/repos/asf/maven.git
commit b9c7c4af6e2e93e2d0ac500d4dcc720e26fe217d Author: tibordigana <[email protected]> AuthorDate: Wed Jul 31 17:22:07 2019 +0200 IT archives --- Jenkinsfile | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index af9a395..0998f02 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -97,22 +97,29 @@ for (String os in runITsOses) { bat "if exist apache-maven-dist.zip del /q apache-maven-dist.zip" } unstash 'dist' - withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[ - junitPublisher(ignoreAttachments: false) - ]) { - String cmd = "${runITscommand} -DmavenDistro=$WORK_DIR/apache-maven-dist.zip -Dmaven.test.failure.ignore=true -Dmaven.skip.rc=true" - if (stageId.endsWith('-jdk7')) { - // Java 7u80 has TLS 1.2 disabled by default: need to explicitly enable - cmd = "${cmd} -Dhttps.protocols=TLSv1.2" - } - - if (isUnix()) { - sh "${cmd}" - } else { - bat "${cmd}" + try { + withMaven(jdk: jdkName, maven: mvnName, mavenLocalRepo:"${WORK_DIR}/it-local-repo", options:[ + junitPublisher(ignoreAttachments: false) + ]) { + String cmd = "${runITscommand} -DmavenDistro=$WORK_DIR/apache-maven-dist.zip -Dmaven.test.failure.ignore=true -Dmaven.skip.rc=true" + if (stageId.endsWith('-jdk7')) { + // Java 7u80 has TLS 1.2 disabled by default: need to explicitly enable + cmd = "${cmd} -Dhttps.protocols=TLSv1.2" + } + + if (isUnix()) { + sh 'df -hT' + sh "${cmd}" + } else { + bat 'wmic logicaldisk get size,freespace,caption' + bat "${cmd}" + } } + } finally { + archiveDirs(stageId, ['core-it-suite-logs':'core-it-suite/target/test-classes', + 'core-it-suite-reports':'core-it-suite/target/surefire-reports']) + deleteDir() // clean up after ourselves to reduce disk space } - deleteDir() // clean up after ourselves to reduce disk space } } } @@ -156,3 +163,11 @@ parallel(runITsTasks) jenkinsNotify() } } + +def archiveDirs(stageId, archives) { + archives.each { archivePrefix, pathToContent -> + if (fileExists(pathToContent)) { + zip(zipFile: "${archivePrefix}-${stageId}.zip", dir: pathToContent, archive: true) + } + } +}
