Skip to content
Permalink
Browse files
Reuse local maven cache + add PR comment trigger
  • Loading branch information
tbouron committed Dec 5, 2019
1 parent 9da8faf commit 0f56b319709e709474dba6d145077632f464e6fb
Showing 1 changed file with 8 additions and 4 deletions.
@@ -18,6 +18,12 @@
*/

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

catchError {
def environmentDockerImage

@@ -36,20 +42,18 @@ node(label: 'ubuntu') {
}

stage('Run tests') {
environmentDockerImage.inside('-i --name brooklyn-${DOCKER_TAG} --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v ${WORKSPACE}:/usr/build -w /usr/build') {
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 clean install -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} --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v ${WORKSPACE}:/usr/build -w /usr/build') {
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 -DskipTests -Duser.home=/var/maven -Duser.name=jenkins'
}
}

// TODO: Publish docker image to https://hub.docker.com/r/apache/brooklyn/ ?
}
}
}

0 comments on commit 0f56b31

Please sign in to comment.