Merge "Added support for Ci Skip Plugin"

This commit is contained in:
Jenkins 2014-02-03 16:57:26 +00:00 committed by Gerrit Code Review
commit 1c305f0309
4 changed files with 45 additions and 1 deletions

View File

@ -36,6 +36,35 @@ import jenkins_jobs.modules.base
from jenkins_jobs.modules.builders import create_builders
def ci_skip(parser, xml_parent, data):
"""yaml: ci-skip
Skip making a build for certain push.
Just add [ci skip] into your commit's message to let Jenkins know,
that you do not want to perform build for the next push.
Requires the Jenkins `Ci Skip Plugin.
<https://wiki.jenkins-ci.org/display/JENKINS/Ci+Skip+Plugin>`_
Example:
.. literalinclude:: /../../tests/wrappers/fixtures/ci-skip001.yaml
"""
rpobj = XML.SubElement(xml_parent, 'ruby-proxy-object')
robj = XML.SubElement(rpobj, 'ruby-object', attrib={
'pluginid': 'ci-skip',
'ruby-class': 'Jenkins::Tasks::BuildWrapperProxy'
})
pluginid = XML.SubElement(robj, 'pluginid', {
'pluginid': 'ci-skip', 'ruby-class': 'String'
})
pluginid.text = 'ci-skip'
obj = XML.SubElement(robj, 'object', {
'ruby-class': 'CiSkipWrapper', 'pluginid': 'ci-skip'
})
ciskip = XML.SubElement(obj, 'ci__skip', {
'pluginid': 'ci-skip', 'ruby-class': 'NilClass'
})
def timeout(parser, xml_parent, data):
"""yaml: timeout
Abort the build if it runs too long.

View File

@ -21,7 +21,6 @@ requires = setup.parse_requirements()
test_requires = setup.parse_requirements(['tools/test-requires'])
depend_links = setup.parse_dependency_links()
setuptools.setup(
name='jenkins-job-builder',
version=version.canonical_version_string(always=True),
@ -196,6 +195,7 @@ setuptools.setup(
'ansicolor=jenkins_jobs.modules.wrappers:ansicolor',
'build-name=jenkins_jobs.modules.wrappers:build_name',
'build-user-vars=jenkins_jobs.modules.wrappers:build_user_vars',
'ci-skip=jenkins_jobs.modules.wrappers:ci_skip',
'copy-to-slave=jenkins_jobs.modules.wrappers:copy_to_slave',
'env-file=jenkins_jobs.modules.wrappers:env_file',
'inject=jenkins_jobs.modules.wrappers:inject',

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<buildWrappers>
<ruby-proxy-object>
<ruby-object pluginid="ci-skip" ruby-class="Jenkins::Tasks::BuildWrapperProxy">
<pluginid pluginid="ci-skip" ruby-class="String">ci-skip</pluginid>
<object pluginid="ci-skip" ruby-class="CiSkipWrapper">
<ci__skip pluginid="ci-skip" ruby-class="NilClass"/>
</object>
</ruby-object>
</ruby-proxy-object>
</buildWrappers>
</project>

View File

@ -0,0 +1,2 @@
wrappers:
- ci-skip