ci: checkout PR with modified scripts for testing

The `git` command does not allow checking out a non-branch (like a PR),
so it is needed to use `checkout` instead.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-05-27 09:59:42 +02:00
parent 6e3c1dadae
commit b5036489c8

View File

@ -7,9 +7,11 @@ def base = ''
node('cico-workspace') { node('cico-workspace') {
stage('checkout ci repository') { stage('checkout ci repository') {
git url: "${ci_git_repo}", if (params.ghprbPullId != null) {
branch: "${ci_git_branch}", ref = "pull/${ghprbPullId}/head"
changelog: false }
checkout([$class: 'GitSCM', branches: [[name: 'FETCH_HEAD']],
userRemoteConfigs: [[url: "${ci_git_repo}", refspec: "${ref}"]]])
} }
stage('reserve bare-metal machine') { stage('reserve bare-metal machine') {
@ -30,9 +32,6 @@ node('cico-workspace') {
try { try {
stage('prepare bare-metal machine') { stage('prepare bare-metal machine') {
if (params.ghprbPullId != null) {
ref = "pull/${ghprbPullId}/head"
}
if (params.ghprbTargetBranch != null) { if (params.ghprbTargetBranch != null) {
base = "--base=${ghprbTargetBranch}" base = "--base=${ghprbTargetBranch}"
} }