From fa5447f6c9850756cb7e1acb499fd60b749dfcaa Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 12 Dec 2019 20:30:34 +0100 Subject: Jenkins: T1870: fetch pull request refs from GitHub --- Jenkinsfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index 7b6dc49e3..3dee31718 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -88,8 +88,14 @@ pipeline { steps { script { dir('build') { - git branch: getGitBranchName(), - url: getGitRepoURL() + checkout([ + $class: 'GitSCM', + branches: [[name: getGitBranchName()]], + doGenerateSubmoduleConfigurations: false, + extensions: [[$class: 'CleanCheckout']], + submoduleCfg: [], + userRemoteConfigs: [[refspec: "+refs/pull/*:refs/remotes/origin/* +refs/heads/*:refs/remotes/origin/*", url: getGitRepoURL()]] + ]) } } } -- cgit v1.2.3 From 1f810cbd0abd8bb5c9c7a499a253b0c2ddd36b70 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 12 Dec 2019 20:52:48 +0100 Subject: Jenkins: T1870: adjust branch pointer --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index 3dee31718..b070bd939 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -94,7 +94,7 @@ pipeline { doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanCheckout']], submoduleCfg: [], - userRemoteConfigs: [[refspec: "+refs/pull/*:refs/remotes/origin/* +refs/heads/*:refs/remotes/origin/*", url: getGitRepoURL()]] + userRemoteConfigs: [[refspec: "+refs/pull/*/head:refs/remotes/origin/PR-* +refs/heads/*:refs/remotes/origin/*", url: getGitRepoURL()]] ]) } } -- cgit v1.2.3 From 325b3fd14ce7a021ad347231a768f992b97b6804 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 12 Dec 2019 20:56:23 +0100 Subject: Jenkins: T1870: only use pull request refspec --- Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index b070bd939..d5be6d5c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -94,7 +94,11 @@ pipeline { doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanCheckout']], submoduleCfg: [], - userRemoteConfigs: [[refspec: "+refs/pull/*/head:refs/remotes/origin/PR-* +refs/heads/*:refs/remotes/origin/*", url: getGitRepoURL()]] + userRemoteConfigs: [[ + refspec: '+refs/pull/*/head' + + ':refs/remotes/origin/*', + url: getGitRepoURL() + ]] ]) } } -- cgit v1.2.3 From de2716ae67a8d88886686fbd7e8db33b6e1a5ebd Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 12 Dec 2019 21:04:21 +0100 Subject: Jenkins: T1870: add 'PR-' prefix to pull request refspec --- Jenkinsfile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index d5be6d5c9..67787f659 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -88,18 +88,16 @@ pipeline { steps { script { dir('build') { - checkout([ - $class: 'GitSCM', - branches: [[name: getGitBranchName()]], - doGenerateSubmoduleConfigurations: false, - extensions: [[$class: 'CleanCheckout']], - submoduleCfg: [], - userRemoteConfigs: [[ - refspec: '+refs/pull/*/head' + - ':refs/remotes/origin/*', - url: getGitRepoURL() - ]] - ]) + scm { + git { + remote { + name(getGitRepoName()) + url(getGitRepoURL()) + refspec('+refs/pull/*:refs/remotes/origin/pr/*') + } + branch('${sha1}') + } + } } } } -- cgit v1.2.3