Merge "Allow raw XML at project top-level"

This commit is contained in:
Jenkins 2015-12-14 03:00:16 +00:00 committed by Gerrit Code Review
commit 959eb4b909
3 changed files with 23 additions and 0 deletions

View File

@ -95,6 +95,10 @@ Example:
history. It adds the ``logrotate`` attribute to the :ref:`Job`
definition. All logrotate attributes default to "-1" (keep forever).
* **raw**:
If present, this section should contain a single **xml** entry. This XML
will be inserted at the top-level of the :ref:`Job` definition.
"""
import xml.etree.ElementTree as XML
@ -171,6 +175,9 @@ class General(jenkins_jobs.modules.base.Base):
lr_anum = XML.SubElement(lr_xml, 'artifactNumToKeep')
lr_anum.text = str(logrotate.get('artifactNumToKeep', -1))
if 'raw' in data:
raw(parser, xml, data['raw'])
def raw(parser, xml_parent, data):
# documented in definition.rst since includes and docs is not working well

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<actions/>
<keepDependencies>false</keepDependencies>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<concurrentBuild>false</concurrentBuild>
<canRoam>true</canRoam>
<createdByJenkinsAutojobs>
<ref>refs/heads/branch</ref>
<tag>feature</tag>
</createdByJenkinsAutojobs>
</project>

View File

@ -0,0 +1,3 @@
raw:
xml: |
<createdByJenkinsAutojobs><ref>refs/heads/branch</ref><tag>feature</tag></createdByJenkinsAutojobs>