Jenkins: Speed up git clones on remote nodes by avoiding stashes
This commit is contained in:
8
.ci/Jenkinsfile
vendored
8
.ci/Jenkinsfile
vendored
@@ -98,8 +98,8 @@ def gitClone(repository, branch) {
|
|||||||
/* Clean workspace. */
|
/* Clean workspace. */
|
||||||
cleanWs()
|
cleanWs()
|
||||||
|
|
||||||
/* Use stashes to avoid performing multiple clones. */
|
/* Use stashes to pass the repository around debian.citadel, as it's known to be faster than git clone there. */
|
||||||
if (env.GIT_STASHED != 'true') {
|
if (env.NODE_NAME != 'debian.citadel' || env.GIT_STASHED != 'true') {
|
||||||
/* Perform clone/checkout. */
|
/* Perform clone/checkout. */
|
||||||
def scmVars = checkout poll: true,
|
def scmVars = checkout poll: true,
|
||||||
changelog: true,
|
changelog: true,
|
||||||
@@ -119,9 +119,11 @@ def gitClone(repository, branch) {
|
|||||||
}
|
}
|
||||||
println "[-] Using git commit [${env.GIT_COMMIT}]"
|
println "[-] Using git commit [${env.GIT_COMMIT}]"
|
||||||
|
|
||||||
/* Stash data and mark it as stashed. */
|
/* Stash data and mark it as stashed if required. */
|
||||||
|
if (env.GIT_STASHED != 'true') {
|
||||||
stash name: 'git', useDefaultExcludes: false
|
stash name: 'git', useDefaultExcludes: false
|
||||||
env.GIT_STASHED = 'true'
|
env.GIT_STASHED = 'true'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Unstash data. */
|
/* Unstash data. */
|
||||||
unstash name: 'git'
|
unstash name: 'git'
|
||||||
|
|||||||
Reference in New Issue
Block a user