MCS-425 - Perform a sparse checkout of items to import from a release repo
This commit is contained in:
parent
7e5c624d72
commit
8961f250b1
2 changed files with 35 additions and 1 deletions
|
|
@ -42,7 +42,7 @@ def rewritemetafileasreleased(meta, String filepath) {
|
|||
meta.saveJsonSerialised(filepath)
|
||||
}
|
||||
|
||||
def artifactimportfromrepo(meta, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) {
|
||||
def hierarchyartifactimportfromrepo(meta, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) {
|
||||
def rooturl = repo.trim()
|
||||
def rootrevision = revision.trim()
|
||||
echo "Cloning root release repo: ${rooturl}, revision: ${rootrevision} at folder: ${destpath}"
|
||||
|
|
@ -76,6 +76,27 @@ def artifactimportfromrepo(meta, String repo, String revision, String destpath,
|
|||
return importedmeta
|
||||
}
|
||||
|
||||
def artifactimportfromrepo(meta, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) {
|
||||
def rooturl = repo.trim()
|
||||
def rootrevision = revision.trim()
|
||||
echo "Cloning root release repo: ${rooturl}, revision: ${rootrevision} at folder: ${destpath}"
|
||||
|
||||
def ArrayList<String> sparseitemlist = gh.convertstringitemstopublish(filter) {
|
||||
gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist)
|
||||
|
||||
def importedmeta = meta.importrelated(destpath)
|
||||
|
||||
gh.stripgithistory(destpath)
|
||||
def metafilepath = "${destpath}/${meta.metafilepath()}"
|
||||
echo "Marking root meta as released and rewriting meta file: ${metafilepath}"
|
||||
rewritemetafileasreleased(meta, metafilepath)
|
||||
|
||||
if (incrementversionnumber) {
|
||||
meta.buildstampinfo.changerevision(versiongenerator.incrementrevision(meta.buildstampinfo.revision, importedmeta.buildstampinfo.revision))
|
||||
}
|
||||
return importedmeta
|
||||
}
|
||||
|
||||
def artifactimport(meta, String source, String jenkinsjob, buildnumberorselector, String repo, String revision, String destpath, boolean incrementversionnumber = true, String filter = '**', String excludes = '', boolean fingerprint = false) {
|
||||
switch (source) {
|
||||
case "Jenkins job artifact":
|
||||
|
|
|
|||
|
|
@ -148,6 +148,19 @@ def convertitemstopublish(String itemstopublishstring) {
|
|||
return paths
|
||||
}
|
||||
|
||||
def convertstringitemstopublish(String itemstopublishstring) {
|
||||
def List paths = []
|
||||
|
||||
def String[] items = itemstopublishstring.split(',')
|
||||
def String allpaths = ""
|
||||
for(String item : items) {
|
||||
paths.add(item)
|
||||
allpaths += "${path}\n"
|
||||
}
|
||||
echo "Selected item to publish:\n${allpaths}"
|
||||
return paths
|
||||
}
|
||||
|
||||
// Publish selected items from a release to the customer folder on the ftp site
|
||||
// itemstopublishstring is a comma-seperated set of strings in this format <ProductName>#<ComponentName>#<PathToPublishableItem>
|
||||
def publishhierarchy(releasemeta, String itemstopublishstring, String customer, String softwarerelease, String maxdepth) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue