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,7 +29,9 @@ node('cico-workspace') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
||||||
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
if (ref != git_since) {
|
||||||
|
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('check doc-only change') {
|
stage('check doc-only change') {
|
||||||
|
@ -47,7 +47,9 @@ node('cico-workspace') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
||||||
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
if (ref != git_since) {
|
||||||
|
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('check doc-only change') {
|
stage('check doc-only change') {
|
||||||
|
@ -57,7 +57,9 @@ node('cico-workspace') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
||||||
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
if (ref != git_since) {
|
||||||
|
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('check doc-only change') {
|
stage('check doc-only change') {
|
||||||
|
@ -73,7 +73,9 @@ node('cico-workspace') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
||||||
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
if (ref != git_since) {
|
||||||
|
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('check doc-only change') {
|
stage('check doc-only change') {
|
||||||
|
@ -70,7 +70,9 @@ node('cico-workspace') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
||||||
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
if (ref != git_since) {
|
||||||
|
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('check doc-only change') {
|
stage('check doc-only change') {
|
||||||
|
@ -70,7 +70,9 @@ node('cico-workspace') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
sh "git clone --depth=1 --branch='${git_since}' '${git_repo}' ~/build/ceph-csi"
|
||||||
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
if (ref != git_since) {
|
||||||
|
sh "cd ~/build/ceph-csi && git fetch origin ${ref} && git checkout -b ${ref} FETCH_HEAD"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('check doc-only change') {
|
stage('check doc-only change') {
|
||||||
|
Loading…
Reference in New Issue
Block a user