This is an automated email from the ASF dual-hosted git repository. sjaranowski pushed a commit to branch jenkins-deploy-master in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit e1c84af2739b4920fae5ea7281da0231cb7c1822 Author: Slawomir Jaranowski <[email protected]> AuthorDate: Fri Dec 31 16:57:54 2021 +0100 Deploy artifacts only for master branch --- Jenkinsfile | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2ef2b4a..c811269 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,7 +36,7 @@ final def jdks = [18, 17, 8] final def options = ['-e', '-V', '-B', '-nsu', '-P', 'run-its'] final def goals = ['clean', 'install'] -final def goalsDepl = ['clean', 'deploy', 'jacoco:report'] +final def goalsDepl = ['clean', 'deploy'] final Map stages = [:] oses.eachWithIndex { osMapping, indexOfOs -> @@ -69,7 +69,7 @@ oses.eachWithIndex { osMapping, indexOfOs -> allOptions += '--no-transfer-progress' } ws(dir: "${os == 'windows' ? "${TEMP}\\${BUILD_TAG}" : pwd()}") { - buildProcess(stageKey, jdkName, mvnName, first ? goalsDepl : goals, allOptions, mavenOpts, first) + buildProcess(stageKey, jdkName, mvnName, allOptions, mavenOpts, first) } } } @@ -113,7 +113,7 @@ timeout(time: 12, unit: 'HOURS') { } } -def buildProcess(String stageKey, String jdkName, String mvnName, goals, options, mavenOpts, boolean makeReports) { +def buildProcess(String stageKey, String jdkName, String mvnName, options, mavenOpts, boolean first) { cleanWs() def errorStatus = -99 try { @@ -129,8 +129,22 @@ def buildProcess(String stageKey, String jdkName, String mvnName, goals, options println "Maven Local Repository = ${mvnLocalRepoDir}." assert mvnLocalRepoDir != null : 'Local Maven Repository is undefined.' - def properties = ["-Djacoco.skip=${!makeReports}", "\"-Dmaven.repo.local=${mvnLocalRepoDir}\""] - def cmd = ['mvn'] + goals + options + properties + def properties = ["-Djacoco.skip=${!first}", "\"-Dmaven.repo.local=${mvnLocalRepoDir}\""] + def cmd = ['mvn'] + + println "111 first=" + first + "branch=" + env.BRANCH_NAME + + if ( first && env.BRANCH_NAME == 'master' ) { + cmd += goalsDepl + } else { + cmd += goals + } + + println "222" + + cmd += options + properties + + println "333" stage("build ${stageKey}") { @@ -166,7 +180,7 @@ def buildProcess(String stageKey, String jdkName, String mvnName, goals, options } } finally { try { - if (makeReports) { + if (first) { jacoco(changeBuildStatus: false, execPattern: '**/*.exec', sourcePattern: sourcesPatternCsv(),
