Daniel Kunz | 4afe27b | 2017-08-11 09:25:36 +0200 | [diff] [blame] | 1 | properties([ |
| 2 | buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')), |
Daniel Kunz | 7c114f6 | 2017-08-11 10:19:54 +0200 | [diff] [blame] | 3 | parameters([string(defaultValue: '', description: '''A specific commit ID can be provided to build older releases. If no ID is entered then the latest commit (HEAD) is used.''', name: 'COMMIT_ID')]), |
Daniel Kunz | 3ed10f1 | 2017-08-11 10:16:59 +0200 | [diff] [blame] | 4 | pipelineTriggers([pollSCM('H/15 * * * *')]) |
Daniel Kunz | 4afe27b | 2017-08-11 09:25:36 +0200 | [diff] [blame] | 5 | ]) |
| 6 | node { |
| 7 | withEnv([]) { |
| 8 | try { |
| 9 | stage('checkout') { |
| 10 | echo 'Checkout...' |
| 11 | checkout scm |
| 12 | sh 'git rev-parse HEAD' |
| 13 | sh 'ls' |
| 14 | } |
| 15 | stage('prepare-env') { |
| 16 | sh './build/org.eclipse.app4mc.build/hudson/init_mylyn.sh' |
| 17 | //sh './build/org.eclipse.app4mc.build/setup_env.sh' |
| 18 | } |
| 19 | stage('build') { |
| 20 | wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: false]) { |
| 21 | dir('build/org.eclipse.app4mc.build/') { |
| 22 | withMaven(jdk: 'jdk1.8.0-latest', maven: 'apache-maven-latest') { |
| 23 | sh 'mvn clean verify' |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | stage('post-build') { |
| 29 | archiveTarget() |
| 30 | junit '**/surefire-reports/TEST*.xml' |
| 31 | } |
| 32 | } catch (e) { |
| 33 | currentBuild.result = "FAILED" |
| 34 | // try to archive build product in error case |
| 35 | emailext body: '''<p>FAILED: Job \'${env.JOB_NAME} [${env.BUILD_NUMBER}]\':</p> |
| 36 | <p>Check console output at "<a href=\'${env.BUILD_URL}\'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>''', recipientProviders: [[$class: 'RequesterRecipientProvider'], [$class: 'FirstFailingBuildSuspectsRecipientProvider']], subject: 'FAILED: Job \'${env.JOB_NAME} [${env.BUILD_NUMBER}]\'' |
| 37 | archiveTarget() |
| 38 | throw e |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | def archiveTarget () { |
| 44 | archiveArtifacts 'build/org.eclipse.app4mc.platform.product/target/' |
| 45 | } |
| 46 | |