add support for python builder

Change-Id: I0b1711c04435287bb851a72df25ebba10c891831
This commit is contained in:
Alexandre Conrad 2014-04-25 13:38:13 -07:00
parent c68249a7f1
commit bd4bbaf3c0
4 changed files with 27 additions and 0 deletions

View File

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

View File

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

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

View File

@ -0,0 +1,2 @@
builders:
- python: 'import foobar'