Added support for Builds chain fingerprinter

Change-Id: I11429534a82587e7cbbd987ecce148b07a5ace47
This commit is contained in:
Kei YAMAZAKI 2014-01-27 15:15:51 +09:00
parent bf3218193b
commit 321fa47ef6
4 changed files with 40 additions and 0 deletions

View File

@ -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.

View File

@ -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',

View 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>

View File

@ -0,0 +1,4 @@
properties:
- builds-chain-fingerprinter:
per-builds-chain: true
per-job-chain: true