Skip to content

Commit

Permalink
Jenkinsfile: avoid creating agenst when not needed (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehildenb authored Jul 23, 2019
1 parent c9f87f7 commit 1c4d9d8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ pipeline {
}
stages {
stage("Init title") {
when { changeRequest() }
when {
changeRequest()
beforeAgent true
}
steps {
script {
currentBuild.displayName = "PR ${env.CHANGE_ID}: ${env.CHANGE_TITLE}"
}
}
}
stage('Build and Test') {
when { changeRequest() }
when {
changeRequest()
beforeAgent true
}
agent {
dockerfile {
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
Expand Down

0 comments on commit 1c4d9d8

Please sign in to comment.