add support for python builder
Change-Id: I0b1711c04435287bb851a72df25ebba10c891831
This commit is contained in:
parent
c68249a7f1
commit
bd4bbaf3c0
@ -62,6 +62,22 @@ def shell(parser, xml_parent, data):
|
||||
XML.SubElement(shell, 'command').text = data
|
||||
|
||||
|
||||
def python(parser, xml_parent, data):
|
||||
"""yaml: python
|
||||
Execute a python command. Requires the Jenkins `Python plugin.
|
||||
<https://wiki.jenkins-ci.org/display/JENKINS/Python+Plugin>`_
|
||||
|
||||
:arg str parameter: the python command to execute
|
||||
|
||||
Example:
|
||||
|
||||
.. literalinclude:: /../../tests/builders/fixtures/python.yaml
|
||||
|
||||
"""
|
||||
python = XML.SubElement(xml_parent, 'hudson.plugins.python.Python')
|
||||
XML.SubElement(python, 'command').text = data
|
||||
|
||||
|
||||
def copyartifact(parser, xml_parent, data):
|
||||
"""yaml: copyartifact
|
||||
|
||||
|
@ -49,6 +49,7 @@ jenkins_jobs.builders =
|
||||
maven-target=jenkins_jobs.modules.builders:maven_target
|
||||
msbuild=jenkins_jobs.modules.builders:msbuild
|
||||
multijob=jenkins_jobs.modules.builders:multijob
|
||||
python=jenkins_jobs.modules.builders:python
|
||||
sbt=jenkins_jobs.modules.builders:sbt
|
||||
shell=jenkins_jobs.modules.builders:shell
|
||||
shining-panda=jenkins_jobs.modules.builders:shining_panda
|
||||
|
8
tests/builders/fixtures/python.xml
Normal file
8
tests/builders/fixtures/python.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<builders>
|
||||
<hudson.plugins.python.Python>
|
||||
<command>import foobar</command>
|
||||
</hudson.plugins.python.Python>
|
||||
</builders>
|
||||
</project>
|
2
tests/builders/fixtures/python.yaml
Normal file
2
tests/builders/fixtures/python.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
builders:
|
||||
- python: 'import foobar'
|
Loading…
Reference in New Issue
Block a user