GIS-1621 - Make source method unique
This commit is contained in:
parent
2f6e213018
commit
39516d4c4b
1 changed files with 19 additions and 19 deletions
|
|
@ -10,7 +10,7 @@ class ImportOptions {
|
|||
boolean m_fingerprint // Do Jenkins fingerprinting on imported artifacts
|
||||
boolean m_nested // Import all child artifacts too (identified in the related meta info
|
||||
boolean m_appendtoparentmeta // Append to parent meta
|
||||
String m_source // Where are the artifacts coming from
|
||||
String m_sourceselect // Where are the artifacts coming from
|
||||
|
||||
String m_jobname
|
||||
def m_buildnumberorselector
|
||||
|
|
@ -19,7 +19,7 @@ class ImportOptions {
|
|||
String m_revision
|
||||
|
||||
ImportOptions(script,
|
||||
String source = 'Jenkins job artifact',
|
||||
String sourceselect = 'Jenkins job artifact',
|
||||
boolean incrementversionnumber = true,
|
||||
String filter = '',
|
||||
String excludes = '',
|
||||
|
|
@ -27,7 +27,7 @@ class ImportOptions {
|
|||
boolean nested = false,
|
||||
appendtoparentmeta = true) {
|
||||
m_script = script
|
||||
m_source = source.trim()
|
||||
m_sourceselect = sourceselect.trim()
|
||||
m_incrementversionnumber = incrementversionnumber
|
||||
m_filter = filter.trim()
|
||||
m_excludes = excludes.trim()
|
||||
|
|
@ -36,18 +36,18 @@ class ImportOptions {
|
|||
m_appendtoparentmeta = appendtoparentmeta
|
||||
}
|
||||
|
||||
void setsource(String source) {
|
||||
source = source.trim()
|
||||
switch (source) {
|
||||
void setsourceselect(String sourceselect) {
|
||||
sourceselect = sourceselect.trim()
|
||||
switch (sourceselect) {
|
||||
case 'Jenkins job artefact':
|
||||
m_source = 'Jenkins job artifact'
|
||||
m_sourceselect = 'Jenkins job artifact'
|
||||
break
|
||||
case 'Jenkins job artifact':
|
||||
case 'Release repository':
|
||||
m_source = source
|
||||
m_sourceselect = sourceselect
|
||||
break
|
||||
default:
|
||||
error("Unknown type of artifact source: ${source}")
|
||||
error("Unknown type of artifact source select: ${m_sourceselect}")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -78,19 +78,19 @@ class ImportOptions {
|
|||
void jenkinsjob(String jobname, String buildnumberorselector) {
|
||||
m_jobname = jobname.trim()
|
||||
m_buildnumberorselector = buildnumberorselector.trim()
|
||||
setsource('Jenkins job artifact')
|
||||
setsourceselect('Jenkins job artifact')
|
||||
}
|
||||
|
||||
void releaserepo(String repo, String revision) {
|
||||
m_repo = repo.trim()
|
||||
m_revision = revision.trim()
|
||||
setsource('Release repository')
|
||||
setsourceselect('Release repository')
|
||||
}
|
||||
|
||||
void source(String source, String jobname, String buildnumberorselector, String repo, String revision) {
|
||||
void source(String sourceselect, String jobname, String buildnumberorselector, String repo, String revision) {
|
||||
jenkinsjob(jobname, buildnumberorselector)
|
||||
releaserepo(repo, revision)
|
||||
setsource(source)
|
||||
setsourceselect(sourceselect)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ ImportOptions getNewImportOptions() {
|
|||
}
|
||||
|
||||
def artifactimportfrombuildjob(meta, importoptions, String destpath) {
|
||||
if (importoptions.m_source != 'Jenkins job artifact') {
|
||||
if (importoptions.m_sourceselect != 'Jenkins job artifact') {
|
||||
error("Import options settings have not been set for: Jenkins job artifact")
|
||||
return
|
||||
}
|
||||
|
|
@ -129,7 +129,7 @@ def rewritemetafileasreleased(meta, String filepath) {
|
|||
}
|
||||
|
||||
def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) {
|
||||
if (importoptions.m_source != 'Release repository') {
|
||||
if (importoptions.m_sourceselect != 'Release repository') {
|
||||
error("Import options settings have not been set for: Release repository")
|
||||
return
|
||||
}
|
||||
|
|
@ -173,7 +173,7 @@ def hierarchyartifactimportfromrepo(meta, importoptions, String destpath) {
|
|||
}
|
||||
|
||||
def artifactimportfromrepo(meta, importoptions, String destpath) {
|
||||
if (importoptions.m_source != 'Release repository') {
|
||||
if (importoptions.m_sourceselect != 'Release repository') {
|
||||
error("Import options settings have not been set for: Release repository")
|
||||
return
|
||||
}
|
||||
|
|
@ -199,7 +199,7 @@ def artifactimportfromrepo(meta, importoptions, String destpath) {
|
|||
}
|
||||
|
||||
def artifactimport(meta, importoptions, String destpath) {
|
||||
switch (importoptions.m_source) {
|
||||
switch (importoptions.m_sourceselect) {
|
||||
case 'Jenkins job artifact':
|
||||
case 'Jenkins job artefact':
|
||||
return artifactimportfrombuildjob(meta, importoptions, destpath)
|
||||
|
|
@ -216,7 +216,7 @@ def artifactimport(meta, importoptions, String destpath) {
|
|||
|
||||
// Deprecated (use above)
|
||||
def artifactimport(meta,
|
||||
String source,
|
||||
String sourceselect,
|
||||
String jenkinsjob,
|
||||
buildnumberorselector,
|
||||
String repo,
|
||||
|
|
@ -230,7 +230,7 @@ def artifactimport(meta,
|
|||
echo "DEPRECATED method: artifactimport(meta, String source, String jenkinsjob, buildnumberorselector, String repo, String revision, String destpath ...)"
|
||||
def importoptions = getNewImportOptions()
|
||||
|
||||
importoptions.source(source, jenkinsjob, buildnumberorselector, repo, revision)
|
||||
importoptions.source(sourceselect, jenkinsjob, buildnumberorselector, repo, revision)
|
||||
importoptions.setincrementversionnumber(incrementversionnumber)
|
||||
importoptions.setfilter(filter)
|
||||
importoptions.setexcludes(excludes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue