String cron_string = BRANCH_NAME == "trunk" ? "10 3 * * *" : "" pipeline { agent { kubernetes agentsetup(containers: 'java8') } options { disableConcurrentBuilds() } triggers { cron(cron_string) } stages { stage('Main') { steps { sh ''' export #rm -rf ~/.m2/repository/org/wamblee mvn install for sitexml in $( find . -name site.xml ) do dir=$( dirname $sitexml ) dir=$( dirname $dir ) dir=$( dirname $dir ) ( cd $dir echo "" echo "Building site for $dir" echo "" mvn -N -o -Ddistrib=/data/www/http.utils.wamblee.org/ site site:deploy echo "" echo "" ) done mvn javadoc:aggregate rsync -av --delete target/site/apidocs/ /data/www/http.wamblee.org/apidocs/ cp src/site/index.html /data/www/http.utils.wamblee.org/ ''' } } } post { always { junit '**/surefire-reports/*.xml' cobertura coberturaReportFile: '**/target/site/cobertura/coverage.xml' } changed { mail to: "jenkins@wamblee.org", subject: "jenkins build:${currentBuild.currentResult}: ${env.JOB_NAME}", body: "${currentBuild.currentResult}: Job ${env.JOB_NAME}\nMore Info can be found here: ${env.BUILD_URL}" } } }