Skip to content
Permalink
Browse files
Update Jenkinsfile to:
- add the pipeline trigger on comment only if we are building a PR
- not deploy artifacts when building master. This will be taken care of during the full brooklyn build on master (see Jenkinsfile configuration at the brooklyn root)
  • Loading branch information
tbouron committed Dec 16, 2019
1 parent 10953ee commit df2952cbd9e3dd0af976bc2d490c99a1b60f6b84
Showing 1 changed file with 6 additions and 13 deletions.
@@ -18,11 +18,13 @@
*/

node(label: 'ubuntu') {
properties([
pipelineTriggers([
issueCommentTrigger('.*test this please.*')
if (env.CHANGE_ID) {
properties([
pipelineTriggers([
issueCommentTrigger('.*test this please.*')
])
])
])
}

catchError {
def environmentDockerImage
@@ -46,15 +48,6 @@ node(label: 'ubuntu') {
sh 'mvn clean install -Prpm -Pdeb -Duser.home=/var/maven -Duser.name=jenkins'
}
}

// Conditional stage to deploy artifacts, when not building a PR
if (env.CHANGE_ID == null) {
stage('Deploy artifacts') {
environmentDockerImage.inside('-i --name brooklyn-${DOCKER_TAG} -v ${WORKSPACE}/.m2:/var/maven/.m2 --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v ${WORKSPACE}:/usr/build -w /usr/build') {
sh 'mvn deploy -Prpm -Pdeb -DskipTests -Duser.home=/var/maven -Duser.name=jenkins'
}
}
}
}
}

0 comments on commit df2952c

Please sign in to comment.