[scm] Update helpers import to common style
Also update some formatting for mappings. Change-Id: I02460de312b66cbd746f4423f15a31ed5d47f56b Signed-off-by: Thanh Ha <zxiiro@linux.com>
This commit is contained in:
parent
3b777009f3
commit
bdb4509b06
|
@ -42,7 +42,7 @@ import xml.etree.ElementTree as XML
|
||||||
from jenkins_jobs.errors import InvalidAttributeError
|
from jenkins_jobs.errors import InvalidAttributeError
|
||||||
from jenkins_jobs.errors import JenkinsJobsException
|
from jenkins_jobs.errors import JenkinsJobsException
|
||||||
import jenkins_jobs.modules.base
|
import jenkins_jobs.modules.base
|
||||||
from jenkins_jobs.modules.helpers import convert_mapping_to_xml
|
import jenkins_jobs.modules.helpers as helpers
|
||||||
|
|
||||||
|
|
||||||
def git(registry, xml_parent, data):
|
def git(registry, xml_parent, data):
|
||||||
|
@ -249,8 +249,8 @@ def git(registry, xml_parent, data):
|
||||||
if 'url' in remoteParams:
|
if 'url' in remoteParams:
|
||||||
remoteURL = remoteParams['url']
|
remoteURL = remoteParams['url']
|
||||||
else:
|
else:
|
||||||
raise JenkinsJobsException('Must specify a url for git remote \"' +
|
raise JenkinsJobsException(
|
||||||
remoteName + '"')
|
'Must specify a url for git remote \"' + remoteName + '"')
|
||||||
XML.SubElement(huser, 'url').text = remoteURL
|
XML.SubElement(huser, 'url').text = remoteURL
|
||||||
if 'credentials-id' in remoteParams:
|
if 'credentials-id' in remoteParams:
|
||||||
credentialsId = remoteParams['credentials-id']
|
credentialsId = remoteParams['credentials-id']
|
||||||
|
@ -384,8 +384,10 @@ def git(registry, xml_parent, data):
|
||||||
clo = XML.SubElement(exts_node, impl_prefix + 'CloneOption')
|
clo = XML.SubElement(exts_node, impl_prefix + 'CloneOption')
|
||||||
clone_mapping = [
|
clone_mapping = [
|
||||||
('shallow-clone', 'shallow', False),
|
('shallow-clone', 'shallow', False),
|
||||||
('depth', 'depth', 1)]
|
('depth', 'depth', 1),
|
||||||
convert_mapping_to_xml(clo, data, clone_mapping, fail_required=True)
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
|
clo, data, clone_mapping, fail_required=True)
|
||||||
if 'do-not-fetch-tags' in data:
|
if 'do-not-fetch-tags' in data:
|
||||||
XML.SubElement(clo, 'noTags').text = str(
|
XML.SubElement(clo, 'noTags').text = str(
|
||||||
data.get('do-not-fetch-tags', False)).lower()
|
data.get('do-not-fetch-tags', False)).lower()
|
||||||
|
@ -568,9 +570,11 @@ def cvs(registry, xml_parent, data):
|
||||||
repo_tag = XML.SubElement(repos_tag, prefix + 'CvsRepository')
|
repo_tag = XML.SubElement(repos_tag, prefix + 'CvsRepository')
|
||||||
|
|
||||||
compression_level = repo.get('compression-level', '-1')
|
compression_level = repo.get('compression-level', '-1')
|
||||||
repo_mapping = [('root', 'cvsRoot', None),
|
repo_mapping = [
|
||||||
('', 'compressionLevel', int(compression_level), range(-1, 10))]
|
('root', 'cvsRoot', None),
|
||||||
convert_mapping_to_xml(repo_tag,
|
('', 'compressionLevel', int(compression_level), range(-1, 10)),
|
||||||
|
]
|
||||||
|
helpers.convert_mapping_to_xml(repo_tag,
|
||||||
repo, repo_mapping, fail_required=True)
|
repo, repo_mapping, fail_required=True)
|
||||||
|
|
||||||
items_tag = XML.SubElement(repo_tag, 'repositoryItems')
|
items_tag = XML.SubElement(repo_tag, 'repositoryItems')
|
||||||
|
@ -584,15 +588,18 @@ def cvs(registry, xml_parent, data):
|
||||||
'Location').format(prefix, valid_loc_types[loc_type])
|
'Location').format(prefix, valid_loc_types[loc_type])
|
||||||
loc_tag = XML.SubElement(item_tag, 'location',
|
loc_tag = XML.SubElement(item_tag, 'location',
|
||||||
{'class': loc_class})
|
{'class': loc_class})
|
||||||
mapping = [('type', 'locationType', 'HEAD')]
|
mapping = [
|
||||||
convert_mapping_to_xml(
|
('type', 'locationType', 'HEAD'),
|
||||||
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
loc_tag, location, mapping, fail_required=True)
|
loc_tag, location, mapping, fail_required=True)
|
||||||
|
|
||||||
if loc_type != 'HEAD':
|
if loc_type != 'HEAD':
|
||||||
mapping = [
|
mapping = [
|
||||||
('name', 'locationName', ''),
|
('name', 'locationName', ''),
|
||||||
('use-head', 'useHeadIfNotFound', False)]
|
('use-head', 'useHeadIfNotFound', False),
|
||||||
convert_mapping_to_xml(
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
loc_tag, location, mapping, fail_required=True)
|
loc_tag, location, mapping, fail_required=True)
|
||||||
|
|
||||||
modules = location.get('modules')
|
modules = location.get('modules')
|
||||||
|
@ -601,8 +608,9 @@ def cvs(registry, xml_parent, data):
|
||||||
module_tag = XML.SubElement(modules_tag, prefix + 'CvsModule')
|
module_tag = XML.SubElement(modules_tag, prefix + 'CvsModule')
|
||||||
mapping = [
|
mapping = [
|
||||||
('remote', 'remoteName', None),
|
('remote', 'remoteName', None),
|
||||||
('local-name', 'localName', '')]
|
('local-name', 'localName', ''),
|
||||||
convert_mapping_to_xml(
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
module_tag, module, mapping, fail_required=True)
|
module_tag, module, mapping, fail_required=True)
|
||||||
|
|
||||||
excluded = repo.get('excluded-regions', [])
|
excluded = repo.get('excluded-regions', [])
|
||||||
|
@ -618,8 +626,9 @@ def cvs(registry, xml_parent, data):
|
||||||
('skip-changelog', 'skipChangeLog', False),
|
('skip-changelog', 'skipChangeLog', False),
|
||||||
('show-all-output', 'disableCvsQuiet', False),
|
('show-all-output', 'disableCvsQuiet', False),
|
||||||
('clean-checkout', 'cleanOnFailedUpdate', False),
|
('clean-checkout', 'cleanOnFailedUpdate', False),
|
||||||
('clean-copy', 'forceCleanCopy', False)]
|
('clean-copy', 'forceCleanCopy', False),
|
||||||
convert_mapping_to_xml(cvs, data, mappings, fail_required=True)
|
]
|
||||||
|
helpers.convert_mapping_to_xml(cvs, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def repo(registry, xml_parent, data):
|
def repo(registry, xml_parent, data):
|
||||||
|
@ -682,7 +691,7 @@ def repo(registry, xml_parent, data):
|
||||||
('trace', 'trace', False),
|
('trace', 'trace', False),
|
||||||
('show-all-changes', 'showAllChanges', False),
|
('show-all-changes', 'showAllChanges', False),
|
||||||
]
|
]
|
||||||
convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
||||||
|
|
||||||
optional_mapping = [
|
optional_mapping = [
|
||||||
# option, xml name, default value
|
# option, xml name, default value
|
||||||
|
@ -694,7 +703,8 @@ def repo(registry, xml_parent, data):
|
||||||
('mirror-dir', 'mirrorDir', None),
|
('mirror-dir', 'mirrorDir', None),
|
||||||
('local-manifest', 'localManifest', None),
|
('local-manifest', 'localManifest', None),
|
||||||
]
|
]
|
||||||
convert_mapping_to_xml(scm, data, optional_mapping, fail_required=False)
|
helpers.convert_mapping_to_xml(
|
||||||
|
scm, data, optional_mapping, fail_required=False)
|
||||||
|
|
||||||
# ignore-projects does not follow the same pattern of the other parameters,
|
# ignore-projects does not follow the same pattern of the other parameters,
|
||||||
# so process it here:
|
# so process it here:
|
||||||
|
@ -732,8 +742,9 @@ def store(registry, xml_parent, data):
|
||||||
{'class': '{0}.StoreSCM'.format(namespace)})
|
{'class': '{0}.StoreSCM'.format(namespace)})
|
||||||
mapping = [
|
mapping = [
|
||||||
('script', 'scriptName', None),
|
('script', 'scriptName', None),
|
||||||
('repository', 'repositoryName', None)]
|
('repository', 'repositoryName', None),
|
||||||
convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
]
|
||||||
|
helpers.convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
||||||
|
|
||||||
pundle_specs = data.get('pundles', [])
|
pundle_specs = data.get('pundles', [])
|
||||||
if not pundle_specs:
|
if not pundle_specs:
|
||||||
|
@ -747,16 +758,19 @@ def store(registry, xml_parent, data):
|
||||||
pundle_name = pundle_spec[pundle_type]
|
pundle_name = pundle_spec[pundle_type]
|
||||||
mapping = [
|
mapping = [
|
||||||
('', 'name', pundle_name),
|
('', 'name', pundle_name),
|
||||||
('', 'pundleType', pundle_type.upper(), valid_pundle_types)]
|
('', 'pundleType', pundle_type.upper(), valid_pundle_types),
|
||||||
convert_mapping_to_xml(pundle, data, mapping, fail_required=True)
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
|
pundle, data, mapping, fail_required=True)
|
||||||
|
|
||||||
generate_parcel = 'parcel-builder-file' in data
|
generate_parcel = 'parcel-builder-file' in data
|
||||||
mapping_optional = [
|
mapping_optional = [
|
||||||
('version-regex', 'versionRegex', None),
|
('version-regex', 'versionRegex', None),
|
||||||
('minimum-blessing', 'minimumBlessingLevel', None),
|
('minimum-blessing', 'minimumBlessingLevel', None),
|
||||||
('', 'generateParcelBuilderInputFile', generate_parcel),
|
('', 'generateParcelBuilderInputFile', generate_parcel),
|
||||||
('parcel-builder-file', 'parcelBuilderInputFilename', None)]
|
('parcel-builder-file', 'parcelBuilderInputFilename', None),
|
||||||
convert_mapping_to_xml(scm,
|
]
|
||||||
|
helpers.convert_mapping_to_xml(scm,
|
||||||
data, mapping_optional, fail_required=False)
|
data, mapping_optional, fail_required=False)
|
||||||
|
|
||||||
|
|
||||||
|
@ -826,8 +840,11 @@ def svn(registry, xml_parent, data):
|
||||||
if 'viewvc-url' in data:
|
if 'viewvc-url' in data:
|
||||||
browser = XML.SubElement(
|
browser = XML.SubElement(
|
||||||
scm, 'browser', {'class': 'hudson.scm.browsers.ViewSVN'})
|
scm, 'browser', {'class': 'hudson.scm.browsers.ViewSVN'})
|
||||||
mapping = [('viewvc-url', 'url', None)]
|
mapping = [
|
||||||
convert_mapping_to_xml(browser, data, mapping, fail_required=True)
|
('viewvc-url', 'url', None),
|
||||||
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
|
browser, data, mapping, fail_required=True)
|
||||||
locations = XML.SubElement(scm, 'locations')
|
locations = XML.SubElement(scm, 'locations')
|
||||||
|
|
||||||
def populate_repo_xml(parent, data):
|
def populate_repo_xml(parent, data):
|
||||||
|
@ -835,15 +852,18 @@ def svn(registry, xml_parent, data):
|
||||||
'hudson.scm.SubversionSCM_-ModuleLocation')
|
'hudson.scm.SubversionSCM_-ModuleLocation')
|
||||||
mapping = [
|
mapping = [
|
||||||
('url', 'remote', None),
|
('url', 'remote', None),
|
||||||
('basedir', 'local', '.')]
|
('basedir', 'local', '.'),
|
||||||
convert_mapping_to_xml(module, data, mapping, fail_required=True)
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
|
module, data, mapping, fail_required=True)
|
||||||
|
|
||||||
repo_depths = ['infinity', 'empty', 'files', 'immediates', 'unknown']
|
repo_depths = ['infinity', 'empty', 'files', 'immediates', 'unknown']
|
||||||
mapping_optional = [
|
mapping_optional = [
|
||||||
('credentials-id', 'credentialsId', None),
|
('credentials-id', 'credentialsId', None),
|
||||||
('repo-depth', 'depthOption', 'infinity', repo_depths),
|
('repo-depth', 'depthOption', 'infinity', repo_depths),
|
||||||
('ignore-externals', 'ignoreExternalsOption', False)]
|
('ignore-externals', 'ignoreExternalsOption', False),
|
||||||
convert_mapping_to_xml(module, data,
|
]
|
||||||
|
helpers.convert_mapping_to_xml(module, data,
|
||||||
mapping_optional, fail_required=False)
|
mapping_optional, fail_required=False)
|
||||||
|
|
||||||
if 'repos' in data:
|
if 'repos' in data:
|
||||||
|
@ -992,7 +1012,7 @@ def tfs(registry, xml_parent, data):
|
||||||
('login', 'userName', ''),
|
('login', 'userName', ''),
|
||||||
('use-update', 'useUpdate', True),
|
('use-update', 'useUpdate', True),
|
||||||
]
|
]
|
||||||
convert_mapping_to_xml(tfs, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(tfs, data, mapping, fail_required=True)
|
||||||
|
|
||||||
store = data.get('web-access', None)
|
store = data.get('web-access', None)
|
||||||
if isinstance(store, list):
|
if isinstance(store, list):
|
||||||
|
@ -1036,8 +1056,10 @@ def workspace(registry, xml_parent, data):
|
||||||
|
|
||||||
mapping = [
|
mapping = [
|
||||||
('parent-job', 'parentJobName', ''),
|
('parent-job', 'parentJobName', ''),
|
||||||
('', 'criteria', criteria, criteria_list)]
|
('', 'criteria', criteria, criteria_list),
|
||||||
convert_mapping_to_xml(workspace, data, mapping, fail_required=True)
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
|
workspace, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def hg(self, xml_parent, data):
|
def hg(self, xml_parent, data):
|
||||||
|
@ -1099,16 +1121,20 @@ def hg(self, xml_parent, data):
|
||||||
|
|
||||||
scm = XML.SubElement(xml_parent, 'scm', {'class':
|
scm = XML.SubElement(xml_parent, 'scm', {'class':
|
||||||
'hudson.plugins.mercurial.MercurialSCM'})
|
'hudson.plugins.mercurial.MercurialSCM'})
|
||||||
mapping = [('url', 'source', None)]
|
mapping = [
|
||||||
convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
('url', 'source', None),
|
||||||
|
]
|
||||||
|
helpers.convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
||||||
|
|
||||||
mapping_optional = [
|
mapping_optional = [
|
||||||
('credentials-id', 'credentialsId', None),
|
('credentials-id', 'credentialsId', None),
|
||||||
('revision-type', 'revisionType', 'branch', revision_type_dict),
|
('revision-type', 'revisionType', 'branch', revision_type_dict),
|
||||||
('revision', 'revision', 'default'),
|
('revision', 'revision', 'default'),
|
||||||
('subdir', 'subdir', None),
|
('subdir', 'subdir', None),
|
||||||
('clean', 'clean', False)]
|
('clean', 'clean', False),
|
||||||
convert_mapping_to_xml(scm, data, mapping_optional, fail_required=False)
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
|
scm, data, mapping_optional, fail_required=False)
|
||||||
|
|
||||||
modules = data.get('modules', '')
|
modules = data.get('modules', '')
|
||||||
if isinstance(modules, list):
|
if isinstance(modules, list):
|
||||||
|
@ -1121,8 +1147,10 @@ def hg(self, xml_parent, data):
|
||||||
bc = XML.SubElement(scm, 'browser',
|
bc = XML.SubElement(scm, 'browser',
|
||||||
{'class': 'hudson.plugins.mercurial.browser.' +
|
{'class': 'hudson.plugins.mercurial.browser.' +
|
||||||
browserdict[browser]})
|
browserdict[browser]})
|
||||||
mapping = [('browser-url', 'url', None, browserdict[browser])]
|
mapping = [
|
||||||
convert_mapping_to_xml(bc, data, mapping, fail_required=True)
|
('browser-url', 'url', None, browserdict[browser]),
|
||||||
|
]
|
||||||
|
helpers.convert_mapping_to_xml(bc, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def openshift_img_streams(registry, xml_parent, data):
|
def openshift_img_streams(registry, xml_parent, data):
|
||||||
|
@ -1177,7 +1205,7 @@ def openshift_img_streams(registry, xml_parent, data):
|
||||||
("auth-token", 'authToken', ''),
|
("auth-token", 'authToken', ''),
|
||||||
("verbose", 'verbose', False),
|
("verbose", 'verbose', False),
|
||||||
]
|
]
|
||||||
convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def bzr(registry, xml_parent, data):
|
def bzr(registry, xml_parent, data):
|
||||||
|
@ -1216,7 +1244,8 @@ def bzr(registry, xml_parent, data):
|
||||||
]
|
]
|
||||||
scm_element = XML.SubElement(
|
scm_element = XML.SubElement(
|
||||||
xml_parent, 'scm', {'class': 'hudson.plugins.bazaar.BazaarSCM'})
|
xml_parent, 'scm', {'class': 'hudson.plugins.bazaar.BazaarSCM'})
|
||||||
convert_mapping_to_xml(scm_element, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(
|
||||||
|
scm_element, data, mapping, fail_required=True)
|
||||||
|
|
||||||
browser_name_to_class = {
|
browser_name_to_class = {
|
||||||
'loggerhead': 'Loggerhead',
|
'loggerhead': 'Loggerhead',
|
||||||
|
@ -1233,12 +1262,17 @@ def bzr(registry, xml_parent, data):
|
||||||
'browser',
|
'browser',
|
||||||
{'class': 'hudson.plugins.bazaar.browsers.{0}'.format(
|
{'class': 'hudson.plugins.bazaar.browsers.{0}'.format(
|
||||||
browser_name_to_class[browser])})
|
browser_name_to_class[browser])})
|
||||||
mapping = [('browser-url', 'url', None)]
|
mapping = [
|
||||||
convert_mapping_to_xml(browser_element, data, mapping, fail_required=True)
|
('browser-url', 'url', None),
|
||||||
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
|
browser_element, data, mapping, fail_required=True)
|
||||||
|
|
||||||
if browser == 'opengrok':
|
if browser == 'opengrok':
|
||||||
mapping = [('opengrok-root-module', 'rootModule', None)]
|
mapping = [
|
||||||
convert_mapping_to_xml(browser_element,
|
('opengrok-root-module', 'rootModule', None),
|
||||||
|
]
|
||||||
|
helpers.convert_mapping_to_xml(browser_element,
|
||||||
data, mapping, fail_required=True)
|
data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1266,10 +1300,15 @@ def url(registry, xml_parent, data):
|
||||||
for data_url in data['url-list']:
|
for data_url in data['url-list']:
|
||||||
url_tuple = XML.SubElement(
|
url_tuple = XML.SubElement(
|
||||||
urls, 'hudson.plugins.URLSCM.URLSCM_-URLTuple')
|
urls, 'hudson.plugins.URLSCM.URLSCM_-URLTuple')
|
||||||
mapping = [('', 'urlString', data_url)]
|
mapping = [
|
||||||
convert_mapping_to_xml(url_tuple, data, mapping, fail_required=True)
|
('', 'urlString', data_url),
|
||||||
mapping = [('clear-workspace', 'clearWorkspace', False)]
|
]
|
||||||
convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(
|
||||||
|
url_tuple, data, mapping, fail_required=True)
|
||||||
|
mapping = [
|
||||||
|
('clear-workspace', 'clearWorkspace', False),
|
||||||
|
]
|
||||||
|
helpers.convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def dimensions(registry, xml_parent, data):
|
def dimensions(registry, xml_parent, data):
|
||||||
|
@ -1347,7 +1386,7 @@ def dimensions(registry, xml_parent, data):
|
||||||
('maintain-timestamp', 'canJobNoTouch', False),
|
('maintain-timestamp', 'canJobNoTouch', False),
|
||||||
('slave-checkout', 'forceAsSlave', False),
|
('slave-checkout', 'forceAsSlave', False),
|
||||||
]
|
]
|
||||||
convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
||||||
|
|
||||||
# Folders to monitor. Default '/'
|
# Folders to monitor. Default '/'
|
||||||
folders = XML.SubElement(scm, 'folders')
|
folders = XML.SubElement(scm, 'folders')
|
||||||
|
@ -1372,7 +1411,8 @@ def dimensions(registry, xml_parent, data):
|
||||||
('timezone', 'jobTimeZone', None),
|
('timezone', 'jobTimeZone', None),
|
||||||
('web-url', 'jobWebUrl', None),
|
('web-url', 'jobWebUrl', None),
|
||||||
]
|
]
|
||||||
convert_mapping_to_xml(scm, data, optional_mapping, fail_required=False)
|
helpers.convert_mapping_to_xml(
|
||||||
|
scm, data, optional_mapping, fail_required=False)
|
||||||
|
|
||||||
|
|
||||||
def accurev(registry, xml_parent, data):
|
def accurev(registry, xml_parent, data):
|
||||||
|
@ -1421,7 +1461,7 @@ def accurev(registry, xml_parent, data):
|
||||||
('build-from-snapshot', 'useSnapshot', False),
|
('build-from-snapshot', 'useSnapshot', False),
|
||||||
('do-not-pop-content', 'dontPopContent', False),
|
('do-not-pop-content', 'dontPopContent', False),
|
||||||
]
|
]
|
||||||
convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(scm, data, mapping, fail_required=True)
|
||||||
|
|
||||||
additional_mapping = [
|
additional_mapping = [
|
||||||
('workspace', 'workspace', None),
|
('workspace', 'workspace', None),
|
||||||
|
@ -1431,7 +1471,8 @@ def accurev(registry, xml_parent, data):
|
||||||
('filter-poll-scm', 'filterForPollSCM', None),
|
('filter-poll-scm', 'filterForPollSCM', None),
|
||||||
('snapshot-name-format', 'snapshotNameFormat', None),
|
('snapshot-name-format', 'snapshotNameFormat', None),
|
||||||
]
|
]
|
||||||
convert_mapping_to_xml(scm, data, additional_mapping, fail_required=False)
|
helpers.convert_mapping_to_xml(
|
||||||
|
scm, data, additional_mapping, fail_required=False)
|
||||||
|
|
||||||
|
|
||||||
class SCM(jenkins_jobs.modules.base.Base):
|
class SCM(jenkins_jobs.modules.base.Base):
|
||||||
|
@ -1486,11 +1527,14 @@ class PipelineSCM(jenkins_jobs.modules.base.Base):
|
||||||
raise JenkinsJobsException("'scm' missing or empty")
|
raise JenkinsJobsException("'scm' missing or empty")
|
||||||
elif scms_count == 1:
|
elif scms_count == 1:
|
||||||
self.registry.dispatch('scm', definition_parent, scms[0])
|
self.registry.dispatch('scm', definition_parent, scms[0])
|
||||||
mapping = [('script-path', 'scriptPath', 'Jenkinsfile'),
|
mapping = [
|
||||||
('lightweight-checkout', 'lightweight', None,
|
('script-path', 'scriptPath', 'Jenkinsfile'),
|
||||||
[True, False])]
|
('lightweight-checkout', 'lightweight', None,
|
||||||
convert_mapping_to_xml(definition_parent, pipeline_dict,
|
[True, False]),
|
||||||
mapping, fail_required=False)
|
]
|
||||||
|
helpers.convert_mapping_to_xml(
|
||||||
|
definition_parent, pipeline_dict, mapping,
|
||||||
|
fail_required=False)
|
||||||
else:
|
else:
|
||||||
raise JenkinsJobsException('Only one SCM can be specified '
|
raise JenkinsJobsException('Only one SCM can be specified '
|
||||||
'as pipeline-scm')
|
'as pipeline-scm')
|
||||||
|
|
Loading…
Reference in New Issue