This is an automated email from the ASF dual-hosted git repository. sjaranowski pushed a commit to branch jenkis-fix in repository https://gitbox.apache.org/repos/asf/maven-dist-tool.git
commit bfd017506f2f54c9ac51acce776a0a08df4176e1 Author: Slawomir Jaranowski <s.jaranow...@gmail.com> AuthorDate: Wed Oct 30 21:49:30 2024 +0100 Improve jenkins build - publish only on master --- Jenkinsfile | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 115ed8c..3d7603c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,26 +35,41 @@ pipeline { } stage('Check') { when { - branch 'master' + not { branch 'master' } } steps { - withMaven(jdk:'jdk_17_latest', maven:'maven_3_latest', mavenLocalRepo:'.repository', options: [ - artifactsPublisher(disabled: true), - findbugsPublisher(disabled: true), - ]) { - sh "mvn -ntp -V -e -Preporting -Dscreenshot=false clean install site" + try { + withMaven(jdk:'jdk_17_latest', maven:'maven_3_latest', mavenLocalRepo:'.repository', options: [ + artifactsPublisher(disabled: true), + findbugsPublisher(disabled: true), + ]) { + sh "mvn -ntp -V -e -Preporting -Dscreenshot=clean install site" + } + } finally { + archiveArtifacts artifacts: "**/target/site/**/*",allowEmptyArchive: true } } } - } - post { - always { - // not sure what is this - //jenkinsNotify() - archiveArtifacts artifacts: "**/site/*.*",allowEmptyArchive: true - publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/target/site", reportFiles: 'index.html', reportName: 'site', reportTitles: '']) + stage('Publish') { + when { + branch 'master' + } + steps { + try { + withMaven(jdk:'jdk_17_latest', maven:'maven_3_latest', mavenLocalRepo:'.repository', options: [ + artifactsPublisher(disabled: true), + findbugsPublisher(disabled: true), + ]) { + sh "mvn -ntp -V -e -Preporting -Dscreenshot=false clean install site" + } + } finally { + archiveArtifacts artifacts: "**/target/site/**/*",allowEmptyArchive: true + publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/target/site", reportFiles: 'index.html', reportName: 'site', reportTitles: '']) + } + } } } + options { buildDiscarder(logRotator(numToKeepStr:'15')) timeout(time: 10, unit: 'MINUTES')