Squashed 'Common_scripts/' changes from 2c26b22..6a415af
6a415afCORE-594 - Debug installer creationcdd00fdCORE-594 - Debug installer creationeda4801CORE-594 - Debug installer creationfb721bbCORE-594 - Debug installer creationf1987cbCORE-594 - Debug installer creationd282099CORE-594 - Debug installer creation05a32d0CORE-594 - Debug installer creationd70f633CORE-594 - Debug installer creation945f837CORE-594 - Debug installer creation36ed63eCORE-594 - Debug installer creationa1c2d3bCORE-594 - Debug installer creation5b3f7a7CORE-594 - Debug installer creationcfcdf5cCORE-594 - Debug installer creationf821da7CORE-594 - Debug installer creation git-subtree-dir: Common_scripts git-subtree-split:6a415afe26
This commit is contained in:
parent
1b74ea88ff
commit
0852aed1da
2 changed files with 54 additions and 6 deletions
|
|
@ -20,6 +20,8 @@ class ImportOptions {
|
|||
|
||||
String m_repo
|
||||
String m_revision
|
||||
|
||||
boolean m_showdetails
|
||||
|
||||
ImportOptions(script,
|
||||
String sourceselect = 'Jenkins job artifact',
|
||||
|
|
@ -31,7 +33,8 @@ class ImportOptions {
|
|||
boolean flatten = false,
|
||||
boolean includemetainfilter = true,
|
||||
boolean clean = true,
|
||||
appendtoparentmeta = true) {
|
||||
appendtoparentmeta = true,
|
||||
showdetails = false) {
|
||||
m_script = script
|
||||
m_sourceselect = sourceselect.trim()
|
||||
m_incrementversionnumber = incrementversionnumber
|
||||
|
|
@ -43,6 +46,25 @@ class ImportOptions {
|
|||
m_includemetainfilter = includemetainfilter
|
||||
m_clean = clean
|
||||
m_appendtoparentmeta = appendtoparentmeta
|
||||
m_showdetails = showdetails
|
||||
}
|
||||
|
||||
String show() {
|
||||
return """m_incrementversionnumber: ${m_incrementversionnumber}
|
||||
m_filter: ${m_filter}
|
||||
m_excludes: ${m_excludes}
|
||||
m_fingerprint: ${m_fingerprint}
|
||||
m_nested: ${m_nested}
|
||||
m_flatten: ${m_flatten}
|
||||
m_includemetainfilter: ${m_includemetainfilter}
|
||||
m_clean: ${m_clean}
|
||||
m_appendtoparentmeta: ${m_appendtoparentmeta}
|
||||
m_sourceselect: ${m_sourceselect}
|
||||
m_jobname: ${m_jobname}
|
||||
m_buildnumberorselector: ${m_buildnumberorselector}
|
||||
m_repo: ${m_repo}
|
||||
m_revision: ${m_revision}
|
||||
"""
|
||||
}
|
||||
|
||||
void setsourceselect(String sourceselect) {
|
||||
|
|
@ -96,7 +118,7 @@ class ImportOptions {
|
|||
m_appendtoparentmeta = appendtoparentmeta
|
||||
}
|
||||
|
||||
void jenkinsjob(String jobname, buildnumberorselector) {
|
||||
void jenkinsjob(String jobname, String buildnumberorselector) {
|
||||
m_jobname = jobname.trim()
|
||||
m_buildnumberorselector = [
|
||||
$class: 'ParameterizedBuildSelector',
|
||||
|
|
@ -109,7 +131,7 @@ class ImportOptions {
|
|||
m_jobname = jobname.trim()
|
||||
m_buildnumberorselector = [
|
||||
$class: 'ParameterizedBuildSelector',
|
||||
parameterName: "<SpecificBuildSelector plugin='copyartifact@1.41'><buildNumber>${buildnumberorselector}</buildNumber></SpecificBuildSelector>"
|
||||
parameterName: "<SpecificBuildSelector plugin='copyartifact@1.46.2'><buildNumber>${buildnumberorselector}</buildNumber></SpecificBuildSelector>"
|
||||
]
|
||||
setsourceselect('Jenkins job artifact')
|
||||
}
|
||||
|
|
@ -125,6 +147,10 @@ class ImportOptions {
|
|||
releaserepo(repo, revision)
|
||||
setsourceselect(sourceselect)
|
||||
}
|
||||
|
||||
void showdetails(boolean showdetails) {
|
||||
m_showdetails = showdetails
|
||||
}
|
||||
}
|
||||
|
||||
ImportOptions getNewImportOptions() {
|
||||
|
|
@ -263,6 +289,9 @@ def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) {
|
|||
}
|
||||
|
||||
def artifactimport(meta, ImportOptions importoptions, String destpath) {
|
||||
if (importoptions.m_showdetails) {
|
||||
echo "Importing artifacts:\nImport options:\n${importoptions.show()}\nto: ${destpath}"
|
||||
}
|
||||
switch (importoptions.m_sourceselect) {
|
||||
case 'Jenkins job artifact':
|
||||
case 'Jenkins job artefact':
|
||||
|
|
|
|||
|
|
@ -23,17 +23,32 @@ def copyToFinalPosition(String pathToIntermediate, String finalBaseFolder, Strin
|
|||
}
|
||||
|
||||
// Given details about artifacts to import and details of installers to build, import artifacts that are required
|
||||
def Map artifactsImporter(meta, importer, artifactDetails, installerDetails) {
|
||||
def Map artifactsImporter(meta, importer, toBuild, artifactDetails, installerDetails, boolean showdetails = false) {
|
||||
artifactFetched = [:]
|
||||
|
||||
if (showdetails) {
|
||||
echo ("toBuild:\n${toBuild}\nartifactDetails:\n${artifactDetails}\ninstallerDetails:\n${installerDetails}")
|
||||
}
|
||||
def importoptions = importer.getNewImportOptions()
|
||||
importoptions.showdetails(showdetails)
|
||||
for (installer in toBuild) {
|
||||
def artifactKeys = installerDetails.get(installer)[1]
|
||||
def installerinfo = installerDetails.get(installer)
|
||||
if (showdetails) {
|
||||
echo ("installer:\n${installer}\ninstallerinfo:\n${installerinfo}")
|
||||
}
|
||||
def artifactKeys = installerinfo[1]
|
||||
if (artifactKeys instanceof java.lang.String) {
|
||||
artifactKeys = [ artifactKeys ]
|
||||
}
|
||||
if (showdetails) {
|
||||
echo ("artifactKeys:\n${artifactKeys}")
|
||||
}
|
||||
for (artifactKey in artifactKeys) {
|
||||
(sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetails.get(artifactKey)
|
||||
artifactDetail = artifactDetails.get(artifactKey)
|
||||
if (showdetails) {
|
||||
echo ("artifactKey: ${artifactKey}\nartifactDetail:\n${artifactDetail}")
|
||||
}
|
||||
(sourceProject, sourceselector, destFolder, incrementversionnumber, toCopy, notToCopy, binariesFolders) = artifactDetail
|
||||
if (artifactFetched.get(artifactKey) == null) {
|
||||
importoptions.jenkinsjob(sourceProject, sourceselector)
|
||||
importoptions.setincrementversionnumber(incrementversionnumber)
|
||||
|
|
@ -45,6 +60,9 @@ def Map artifactsImporter(meta, importer, artifactDetails, installerDetails) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (showdetails) {
|
||||
echo ("artifactFetched:\n${artifactFetched}")
|
||||
}
|
||||
return artifactFetched
|
||||
}
|
||||
|
||||
|
|
@ -93,6 +111,7 @@ def checkISMfilebackend(String xml) {
|
|||
def checkISMfile(String ISMfile) {
|
||||
echo "Checking ISM file: ${ISMfile}"
|
||||
def xml = readFile(ISMfile)
|
||||
echo "ISM file xml: ${xml}"
|
||||
(exitcode, message) = checkISMfilebackend(xml)
|
||||
echo message
|
||||
if (exitcode > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue