blob: 03e3cb3135f7b125b14838213dd70ae5e8c4e207 [file] [log] [blame]
Daniel Kunz4afe27b2017-08-11 09:25:36 +02001properties([
2 buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
Daniel Kunz7c114f62017-08-11 10:19:54 +02003 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 Kunz3ed10f12017-08-11 10:16:59 +02004 pipelineTriggers([pollSCM('H/15 * * * *')])
Daniel Kunz4afe27b2017-08-11 09:25:36 +02005 ])
6node {
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 &QUOT;<a href=\'${env.BUILD_URL}\'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>&QUOT;</p>''', recipientProviders: [[$class: 'RequesterRecipientProvider'], [$class: 'FirstFailingBuildSuspectsRecipientProvider']], subject: 'FAILED: Job \'${env.JOB_NAME} [${env.BUILD_NUMBER}]\''
37 archiveTarget()
38 throw e
39 }
40 }
41}
42
43def archiveTarget () {
44 archiveArtifacts 'build/org.eclipse.app4mc.platform.product/target/'
45}
46