ci: do not re-checkout current branch

When tests are started manually (through the Jenkins webui), there is no
PR associated with the job. That means the `git_since` and `ref` are
equal. Trying to create a new branch named `ref` will not work, as the
branch was already created when cloning the repository with `git_since`.

With this change, Jenkins jobs can be started manually. This makes it
possible to run regular/nightly jobs as well.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-04-07 18:09:56 +02:00 committed by mergify[bot]
parent e030097eaa
commit 8f84e592d5
6 changed files with 18 additions and 6 deletions

View File

@ -29,8 +29,10 @@ node('cico-workspace') {
}
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
if (ref != git_since) {
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
}
}
stage('check doc-only change') {
doc_change = sh(

View File

@ -47,8 +47,10 @@ node('cico-workspace') {
}
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
if (ref != git_since) {
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
}
}
stage('check doc-only change') {
doc_change = sh(

View File

@ -57,8 +57,10 @@ node('cico-workspace') {
}
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
if (ref != git_since) {
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
}
}
stage('check doc-only change') {
doc_change = sh(

View File

@ -73,8 +73,10 @@ node('cico-workspace') {
}
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
if (ref != git_since) {
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
}
}
stage('check doc-only change') {
doc_change = sh(

View File

@ -70,8 +70,10 @@ node('cico-workspace') {
}
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
if (ref != git_since) {
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
}
}
stage('check doc-only change') {
doc_change = sh(

View File

@ -70,8 +70,10 @@ node('cico-workspace') {
}
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
if (ref != git_since) {
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
}
}
stage('check doc-only change') {
doc_change = sh(