summaryrefslogtreecommitdiff
path: root/vars/buildPackage.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'vars/buildPackage.groovy')
-rw-r--r--vars/buildPackage.groovy8
1 files changed, 4 insertions, 4 deletions
diff --git a/vars/buildPackage.groovy b/vars/buildPackage.groovy
index edd854b7..c3e35775 100644
--- a/vars/buildPackage.groovy
+++ b/vars/buildPackage.groovy
@@ -35,10 +35,8 @@ def call(description=null, pkgList=null, buildCmd=null) {
script {
// create container name on demand
def branchName = getGitBranchName()
- // Adjust PR target branch name so we can re-map it to the proper
- // Docker image. CHANGE_ID is set only for pull requests, so it is
- // safe to access the pullRequest global variable
- if (env.CHANGE_ID) {
+ // Adjust PR target branch name so we can re-map it to the proper Docker image.
+ if (isPullRequest()) {
branchName = "${env.CHANGE_TARGET}".toLowerCase()
}
if (branchName.equals("master")) {
@@ -63,6 +61,7 @@ def call(description=null, pkgList=null, buildCmd=null) {
DEBIAN_ARCH = sh(returnStdout: true, script: 'dpkg --print-architecture').trim()
}
options {
+ disableConcurrentBuilds()
skipDefaultCheckout()
timeout(time: 60, unit: 'MINUTES')
timestamps()
@@ -106,6 +105,7 @@ def call(description=null, pkgList=null, buildCmd=null) {
beforeAgent true
anyOf {
changeset pattern: "${env.CHANGESET_DIR}"
+ expression { isPullRequest() }
triggeredBy 'TimerTrigger'
triggeredBy cause: "UserIdCause"
}