Revert "Try to use the REPO_ROOT environment variable"
This reverts commit aa04eb23b85ac42d236d21dc489f3a03038fbfba.
This commit is contained in:
parent
eb07ef6dc0
commit
31196dbede
1 changed files with 7 additions and 3 deletions
|
|
@ -19,8 +19,12 @@ def SparseCheckoutPaths sparsecheckoutconfig(ArrayList<String> paths) {
|
|||
return new SparseCheckoutPaths(sparsecheckoutpaths)
|
||||
}
|
||||
|
||||
def gitCheckout(String gitURL, String revision, String targetDir, String repoRoot = env.REPO_ROOT.trim(), int cloneDepth = 1, boolean shallowClone = true, ArrayList<String> sparseitemlist = new ArrayList<String>()) {
|
||||
if (repoRoot == "") {
|
||||
def gitCheckout(String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true, ArrayList<String> sparseitemlist = new ArrayList<String>()) {
|
||||
reporootenv = env.REPO_ROOT
|
||||
if (reporootenv != null && 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([
|
||||
|
|
@ -35,7 +39,7 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo
|
|||
extensions: [
|
||||
[$class: 'GitLFSPull'],
|
||||
[$class: 'CleanBeforeCheckout'],
|
||||
[$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: repoRoot, shallow: shallowClone, timeout: 120],
|
||||
[$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: reporootpath, shallow: shallowClone, timeout: 120],
|
||||
[$class: 'CheckoutOption', timeout: 120],
|
||||
[$class: 'RelativeTargetDirectory', relativeTargetDir: targetDir],
|
||||
sparsecheckoutconfig(sparseitemlist)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue