Skip to content

Commit

Permalink
Mount the docker socket so the Brooklyn docker image can be build on …
Browse files Browse the repository at this point in the history
…Jenkins
  • Loading branch information
tbouron committed Dec 4, 2019
1 parent 44fb8bb commit e573e84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ 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') {
sh 'mvn clean install -Prpm -Pdeb -Duser.home=/var/maven -Duser.name=jenkins'
environmentDockerImage.inside('-i --name brooklyn-${DOCKER_TAG} --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v /var/run/docker.sock:/var/run/docker.sock -v ${WORKSPACE}:/usr/build -w /usr/build') {
sh 'mvn clean install -Prpm -Pdeb -Pdocker -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') {
sh 'mvn deploy -Prpm -Pdeb -DskipTests -Duser.home=/var/maven -Duser.name=jenkins'
environmentDockerImage.inside('-i --name brooklyn-${DOCKER_TAG} --mount type=bind,source="${HOME}/.m2/settings.xml",target=/var/maven/.m2/settings.xml,readonly -v /var/run/docker.sock:/var/run/docker.sock -v ${WORKSPACE}:/usr/build -w /usr/build') {
sh 'mvn deploy -Prpm -Pdeb -Pdocker -DskipTests -Duser.home=/var/maven -Duser.name=jenkins'
}
}

Expand Down

0 comments on commit e573e84

Please sign in to comment.