Check for undefined REPO_ROOT environment variable
This commit is contained in:
parent
d09d20c7b6
commit
9d32414fca
1 changed files with 8 additions and 1 deletions
|
|
@ -7,6 +7,13 @@ String getGitInfo(String workingSetRootPath) {
|
|||
}
|
||||
|
||||
def gitCheckout(String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) {
|
||||
reporootenv = env.REPO_ROOT
|
||||
if (reporootenv != mull && repoRoot != "") {
|
||||
reporootpath = "${reporootenv.trim()}/${repoRoot}"
|
||||
} else {
|
||||
reporootpath = ""
|
||||
echo "To improve Git performance: Define the REPO_ROOT enviroment to a path where a cache of git repositories can be placed on this slave"
|
||||
}
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
userRemoteConfigs: [
|
||||
|
|
@ -18,7 +25,7 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo
|
|||
doGenerateSubmoduleConfigurations: false,
|
||||
extensions: [
|
||||
[$class: 'CleanBeforeCheckout'],
|
||||
[$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: "${REPO_ROOT}/${repoRoot}", shallow: shallowClone, timeout: 120],
|
||||
[$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: reporootpath, shallow: shallowClone, timeout: 120],
|
||||
[$class: 'CheckoutOption', timeout: 60],
|
||||
[$class: 'RelativeTargetDirectory', relativeTargetDir: targetDir]
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue