mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
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:
parent
e030097eaa
commit
8f84e592d5
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user