Merge "Add support for "tox" builder"

This commit is contained in:
Jenkins 2015-12-03 18:38:37 +00:00 committed by Gerrit Code Review
commit 4b0f03017a
6 changed files with 54 additions and 0 deletions

View File

@ -1964,6 +1964,32 @@ def shining_panda(parser, xml_parent, data):
XML.SubElement(t, 'ignoreExitCode').text = str(ignore_exit_code).lower()
def tox(parser, xml_parent, data):
"""yaml: tox
Use tox to build a multi-configuration project. Requires the Jenkins
:jenkins-wiki:`ShiningPanda plugin <ShiningPanda+Plugin>`.
:arg str ini: The TOX configuration file path (default: tox.ini)
:arg bool recreate: If true, create a new environment each time (default:
false)
:arg str toxenv-pattern: The pattern used to build the TOXENV environment
variable. (optional)
Example:
.. literalinclude:: /../../tests/builders/fixtures/tox001.yaml
:language: yaml
"""
pluginelement = 'jenkins.plugins.shiningpanda.builders.ToxBuilder'
t = XML.SubElement(xml_parent, pluginelement)
XML.SubElement(t, 'toxIni').text = data.get('ini', 'tox.ini')
XML.SubElement(t, 'recreate').text = str(
data.get('recreate', False)).lower()
pattern = data.get('toxenv-pattern')
if pattern:
XML.SubElement(t, 'toxenvPattern').text = pattern
def managed_script(parser, xml_parent, data):
"""yaml: managed-script
This step allows to reference and execute a centrally managed

View File

@ -87,6 +87,7 @@ jenkins_jobs.builders =
sonatype-clm=jenkins_jobs.modules.builders:sonatype_clm
ssh-builder=jenkins_jobs.modules.builders:ssh_builder
system-groovy=jenkins_jobs.modules.builders:system_groovy
tox=jenkins_jobs.modules.builders:tox
trigger-builds=jenkins_jobs.modules.builders:trigger_builds
trigger-remote=jenkins_jobs.modules.builders:trigger_remote
jenkins_jobs.reporters =

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<builders>
<jenkins.plugins.shiningpanda.builders.ToxBuilder>
<toxIni>tox.ini</toxIni>
<recreate>true</recreate>
</jenkins.plugins.shiningpanda.builders.ToxBuilder>
</builders>
</project>

View File

@ -0,0 +1,3 @@
builders:
- tox:
recreate: True

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<builders>
<jenkins.plugins.shiningpanda.builders.ToxBuilder>
<toxIni>foo.conf</toxIni>
<recreate>false</recreate>
<toxenvPattern>TOX_ENV</toxenvPattern>
</jenkins.plugins.shiningpanda.builders.ToxBuilder>
</builders>
</project>

View File

@ -0,0 +1,5 @@
builders:
- tox:
ini: "foo.conf"
toxenv-pattern: TOX_ENV