github.com/drone/go-convert@v0.0.0-20240307072510-6bd371c65e61/convert/jenkins/testdata/Jenkinsfile.9 (about) 1 @Library('github.com/triologygmbh/jenkinsfile@6610cd92') _ 2 3 node('docker') { // Require a build executor with docker (label) 4 5 properties([ 6 pipelineTriggers(createPipelineTriggers()), 7 disableConcurrentBuilds(), 8 buildDiscarder(logRotator(numToKeepStr: '10')) 9 ]) 10 11 docker.image('maven:3.5.0-jdk-8').inside { 12 13 catchError { 14 15 stage('Checkout') { 16 checkout scm 17 } 18 19 stage('Build') { 20 sh 'mvn clean install -DskipTests' 21 archiveArtifacts '**/target/*.*ar' 22 } 23 24 parallel( 25 unitTest: { 26 stage('Unit Test') { 27 sh 'mvn test' 28 } 29 }, 30 integrationTest: { 31 stage('Integration Test') { 32 if (isTimeTriggeredBuild()) { 33 sh 'mvn verify -DskipUnitTests -Parq-wildfly-swarm ' 34 } 35 } 36 } 37 ) 38 } 39 } 40 41 // Archive Unit and integration test results, if any 42 junit allowEmptyResults: true, 43 testResults: '**/target/surefire-reports/TEST-*.xml, **/target/failsafe-reports/*.xml' 44 45 mailIfStatusChanged env.EMAIL_RECIPIENTS 46 } 47 48 def createPipelineTriggers() { 49 if (env.BRANCH_NAME == 'master') { 50 // Run a nightly only for master 51 return [cron('H H(0-3) * * 1-5')] 52 } 53 return [] 54 }