summaryrefslogtreecommitdiff
path: root/vars/buildPackage.groovy
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-27 14:57:18 +0200
committerChristian Poessinger <christian@poessinger.com>2020-06-27 14:57:18 +0200
commit2e1e117f96674b6bdbcf51cc62ef5345c6a1509d (patch)
tree8893ceca844b07a0ce29abe26c2cd5dacc36f5b3 /vars/buildPackage.groovy
parente68de0e41fe7bfdee4fddf5f42e3404da09f2bf6 (diff)
downloadvyos-build-2e1e117f96674b6bdbcf51cc62ef5345c6a1509d.tar.gz
vyos-build-2e1e117f96674b6bdbcf51cc62ef5345c6a1509d.zip
Jenkins: lib: T2625: support PullRequest builds
Diffstat (limited to 'vars/buildPackage.groovy')
-rw-r--r--vars/buildPackage.groovy7
1 files changed, 3 insertions, 4 deletions
diff --git a/vars/buildPackage.groovy b/vars/buildPackage.groovy
index edd854b7..463170e6 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")) {
@@ -106,6 +104,7 @@ def call(description=null, pkgList=null, buildCmd=null) {
beforeAgent true
anyOf {
changeset pattern: "${env.CHANGESET_DIR}"
+ expression { isPullRequest() }
triggeredBy 'TimerTrigger'
triggeredBy cause: "UserIdCause"
}