Merge "Add support for "tox" builder"
This commit is contained in:
commit
ca8fb6af2f
@ -1970,6 +1970,32 @@ def shining_panda(parser, xml_parent, data):
|
|||||||
XML.SubElement(t, 'ignoreExitCode').text = str(ignore_exit_code).lower()
|
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):
|
def managed_script(parser, xml_parent, data):
|
||||||
"""yaml: managed-script
|
"""yaml: managed-script
|
||||||
This step allows to reference and execute a centrally managed
|
This step allows to reference and execute a centrally managed
|
||||||
|
9
tests/builders/fixtures/tox001.xml
Normal file
9
tests/builders/fixtures/tox001.xml
Normal 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>
|
3
tests/builders/fixtures/tox001.yaml
Normal file
3
tests/builders/fixtures/tox001.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
builders:
|
||||||
|
- tox:
|
||||||
|
recreate: True
|
10
tests/builders/fixtures/tox002.xml
Normal file
10
tests/builders/fixtures/tox002.xml
Normal 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>
|
5
tests/builders/fixtures/tox002.yaml
Normal file
5
tests/builders/fixtures/tox002.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
builders:
|
||||||
|
- tox:
|
||||||
|
ini: "foo.conf"
|
||||||
|
toxenv-pattern: TOX_ENV
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user