Added support for Builds chain fingerprinter
Change-Id: I11429534a82587e7cbbd987ecce148b07a5ace47
This commit is contained in:
parent
bf3218193b
commit
321fa47ef6
@ -37,6 +37,31 @@ import jenkins_jobs.modules.base
|
||||
from jenkins_jobs.errors import JenkinsJobsException
|
||||
|
||||
|
||||
def builds_chain_fingerprinter(parser, xml_parent, data):
|
||||
"""yaml: builds-chain-fingerprinter
|
||||
Builds chain fingerprinter.
|
||||
Requires the Jenkins `Builds chain fingerprinter Plugin.
|
||||
<https://wiki.jenkins-ci.org/display/JENKINS/Builds+chain+fingerprinter>`_
|
||||
|
||||
:arg bool per-builds-chain: enable builds hierarchy fingerprinting
|
||||
(default False)
|
||||
:arg bool per-job-chain: enable jobs hierarchy fingerprinting
|
||||
(default False)
|
||||
|
||||
Example:
|
||||
|
||||
.. literalinclude:: /../../tests/properties/fixtures/fingerprinter.yaml
|
||||
"""
|
||||
fingerprinter = XML.SubElement(xml_parent,
|
||||
'org.jenkinsci.plugins.'
|
||||
'buildschainfingerprinter.'
|
||||
'AutomaticFingerprintJobProperty')
|
||||
XML.SubElement(fingerprinter, 'isPerBuildsChainEnabled').text = str(
|
||||
data.get('per-builds-chain', False)).lower()
|
||||
XML.SubElement(fingerprinter, 'isPerJobsChainEnabled').text = str(
|
||||
data.get('per-job-chain', False)).lower()
|
||||
|
||||
|
||||
def ownership(parser, xml_parent, data):
|
||||
"""yaml: ownership
|
||||
Plugin provides explicit ownership for jobs and slave nodes.
|
||||
|
2
setup.py
2
setup.py
@ -80,6 +80,8 @@ setuptools.setup(
|
||||
('authenticated-build=jenkins_jobs.modules.properties:'
|
||||
'authenticated_build'),
|
||||
'authorization=jenkins_jobs.modules.properties:authorization',
|
||||
('builds-chain-fingerprinter=jenkins_jobs.modules.properties:'
|
||||
'builds_chain_fingerprinter'),
|
||||
'batch-tasks=jenkins_jobs.modules.properties:batch_tasks',
|
||||
'build-blocker=jenkins_jobs.modules.properties:build_blocker',
|
||||
'extended-choice=jenkins_jobs.modules.properties:extended_choice',
|
||||
|
9
tests/properties/fixtures/fingerprinter.xml
Normal file
9
tests/properties/fixtures/fingerprinter.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<properties>
|
||||
<org.jenkinsci.plugins.buildschainfingerprinter.AutomaticFingerprintJobProperty>
|
||||
<isPerBuildsChainEnabled>true</isPerBuildsChainEnabled>
|
||||
<isPerJobsChainEnabled>true</isPerJobsChainEnabled>
|
||||
</org.jenkinsci.plugins.buildschainfingerprinter.AutomaticFingerprintJobProperty>
|
||||
</properties>
|
||||
</project>
|
4
tests/properties/fixtures/fingerprinter.yaml
Normal file
4
tests/properties/fixtures/fingerprinter.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
properties:
|
||||
- builds-chain-fingerprinter:
|
||||
per-builds-chain: true
|
||||
per-job-chain: true
|
Loading…
Reference in New Issue
Block a user