Update stash plugin
- update stash plugin to convert xml - update test cases Change-Id: I55ce1ee25700200869c711e81f80df3f0b5fc7b3
This commit is contained in:
parent
de631d49d3
commit
d0ce567efb
jenkins_jobs/modules
tests/publishers/fixtures
@ -4417,9 +4417,14 @@ def stash(registry, xml_parent, data):
|
|||||||
:arg bool include-build-number: Include build number in key
|
:arg bool include-build-number: Include build number in key
|
||||||
(default false)
|
(default false)
|
||||||
|
|
||||||
Example:
|
Minimal Example:
|
||||||
|
|
||||||
.. literalinclude:: /../../tests/publishers/fixtures/stash001.yaml
|
.. literalinclude:: /../../tests/publishers/fixtures/stash-minimal.yaml
|
||||||
|
:language: yaml
|
||||||
|
|
||||||
|
Full Example:
|
||||||
|
|
||||||
|
.. literalinclude:: /../../tests/publishers/fixtures/stash-full.yaml
|
||||||
:language: yaml
|
:language: yaml
|
||||||
"""
|
"""
|
||||||
top = XML.SubElement(xml_parent,
|
top = XML.SubElement(xml_parent,
|
||||||
@ -4436,12 +4441,13 @@ def stash(registry, xml_parent, data):
|
|||||||
XML.SubElement(top, 'stashUserPassword'
|
XML.SubElement(top, 'stashUserPassword'
|
||||||
).text = helpers.get_value_from_yaml_or_config_file(
|
).text = helpers.get_value_from_yaml_or_config_file(
|
||||||
'password', 'stash', data, registry.jjb_config)
|
'password', 'stash', data, registry.jjb_config)
|
||||||
|
mappings = [
|
||||||
XML.SubElement(top, 'ignoreUnverifiedSSLPeer').text = str(
|
('ignore-ssl', 'ignoreUnverifiedSSLPeer', False),
|
||||||
data.get('ignore-ssl', False)).lower()
|
('commit-sha1', 'commitSha1', ''),
|
||||||
XML.SubElement(top, 'commitSha1').text = data.get('commit-sha1', '')
|
('include-build-number', 'includeBuildNumberInKey', False)
|
||||||
XML.SubElement(top, 'includeBuildNumberInKey').text = str(
|
]
|
||||||
data.get('include-build-number', False)).lower()
|
helpers.convert_mapping_to_xml(
|
||||||
|
top, data, mappings, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def dependency_check(registry, xml_parent, data):
|
def dependency_check(registry, xml_parent, data):
|
||||||
|
13
tests/publishers/fixtures/stash-full.xml
Normal file
13
tests/publishers/fixtures/stash-full.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<publishers>
|
||||||
|
<org.jenkinsci.plugins.stashNotifier.StashNotifier>
|
||||||
|
<stashServerBaseUrl>https://mystash</stashServerBaseUrl>
|
||||||
|
<stashUserName>a</stashUserName>
|
||||||
|
<stashUserPassword>b</stashUserPassword>
|
||||||
|
<ignoreUnverifiedSSLPeer>true</ignoreUnverifiedSSLPeer>
|
||||||
|
<commitSha1>c</commitSha1>
|
||||||
|
<includeBuildNumberInKey>true</includeBuildNumberInKey>
|
||||||
|
</org.jenkinsci.plugins.stashNotifier.StashNotifier>
|
||||||
|
</publishers>
|
||||||
|
</project>
|
8
tests/publishers/fixtures/stash-full.yaml
Normal file
8
tests/publishers/fixtures/stash-full.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
publishers:
|
||||||
|
- stash:
|
||||||
|
url: "https://mystash"
|
||||||
|
username: a
|
||||||
|
password: b
|
||||||
|
ignore-ssl: true
|
||||||
|
commit-sha1: c
|
||||||
|
include-build-number: true
|
13
tests/publishers/fixtures/stash-minimal.xml
Normal file
13
tests/publishers/fixtures/stash-minimal.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<publishers>
|
||||||
|
<org.jenkinsci.plugins.stashNotifier.StashNotifier>
|
||||||
|
<stashServerBaseUrl/>
|
||||||
|
<stashUserName/>
|
||||||
|
<stashUserPassword/>
|
||||||
|
<ignoreUnverifiedSSLPeer>false</ignoreUnverifiedSSLPeer>
|
||||||
|
<commitSha1/>
|
||||||
|
<includeBuildNumberInKey>false</includeBuildNumberInKey>
|
||||||
|
</org.jenkinsci.plugins.stashNotifier.StashNotifier>
|
||||||
|
</publishers>
|
||||||
|
</project>
|
2
tests/publishers/fixtures/stash-minimal.yaml
Normal file
2
tests/publishers/fixtures/stash-minimal.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
publishers:
|
||||||
|
- stash
|
Loading…
x
Reference in New Issue
Block a user