Try to speed up release repo check out
This commit is contained in:
parent
31196dbede
commit
9f47550d0e
3 changed files with 8 additions and 7 deletions
|
|
@ -32,7 +32,7 @@ def getmetafolderscript() {
|
|||
}
|
||||
|
||||
// Start up boilderplate
|
||||
def start(script, productname = PRODUCT_NAME, subcomponentname = SUBCOMPONENT_NAME, jirakey = JIRA_KEY, releaserepo = RELEASE_REPO, autobuildpath = autobuildroot, commonscriptspath = commonscriptsroot) {
|
||||
def start(script, productname = PRODUCT_NAME, subcomponentname = SUBCOMPONENT_NAME, jirakey = JIRA_KEY, releaserepo = RELEASE_REPO, String repoRootSuffix = "", autobuildpath = autobuildroot, commonscriptspath = commonscriptsroot) {
|
||||
echo "Starting...."
|
||||
|
||||
autobuildroot = autobuildpath
|
||||
|
|
@ -48,7 +48,7 @@ def start(script, productname = PRODUCT_NAME, subcomponentname = SUBCOMPONENT_NA
|
|||
meta.jenkinsbuildinfo.set(JOB_NAME, BUILD_ID.toInteger(), NODE_NAME, now.toString())
|
||||
|
||||
def rr = load("${commonscripts()}/release/registerrepo.groovy")
|
||||
rr.registerrepo(meta, releaserepo)
|
||||
rr.registerrepo(meta, releaserepo, repoRootSuffix)
|
||||
|
||||
def ch = load("${commonscripts()}/configuration/configuration.groovy")
|
||||
ch.registerPipelineScriptConfiguration(meta)
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
vc = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy")
|
||||
|
||||
// Prove the existence of the release repo - otherwise there is a large wait to cycle the build to correct the meta data
|
||||
def registerrepo(meta, String releaserepo) {
|
||||
def registerrepo(meta, String releaserepo, String repoRootSuffix = "") {
|
||||
if (releaserepo?.trim()) {
|
||||
vc.gitCheckout(releaserepo, "origin/master", "tmp/releaserepo")
|
||||
vc.gitCheckout(releaserepo, "origin/master", "tmp/releaserepo", repoRootSuffix)
|
||||
}
|
||||
meta.releaseinfo.set(releaserepo)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@ def SparseCheckoutPaths sparsecheckoutconfig(ArrayList<String> paths) {
|
|||
return new SparseCheckoutPaths(sparsecheckoutpaths)
|
||||
}
|
||||
|
||||
def gitCheckout(String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true, ArrayList<String> sparseitemlist = new ArrayList<String>()) {
|
||||
def gitCheckout(String gitURL, String revision, String targetDir, String repoRootSuffix = "", int cloneDepth = 1, boolean shallowClone = true, ArrayList<String> sparseitemlist = new ArrayList<String>()) {
|
||||
reporootenv = env.REPO_ROOT
|
||||
if (reporootenv != null && repoRoot != "") {
|
||||
reporootpath = "${reporootenv.trim()}/${repoRoot}"
|
||||
if (reporootenv != null && repoRootSuffix != "") {
|
||||
reporootpath = "${reporootenv.trim()}/${repoRootSuffix}"
|
||||
echo "Using release repo: ${reporootpath}"
|
||||
} 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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue