Merge "Added support for Ci Skip Plugin"
This commit is contained in:
commit
1c305f0309
@ -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.
|
||||
|
2
setup.py
2
setup.py
@ -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',
|
||||
|
13
tests/wrappers/fixtures/ci-skip001.xml
Normal file
13
tests/wrappers/fixtures/ci-skip001.xml
Normal 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>
|
2
tests/wrappers/fixtures/ci-skip001.yaml
Normal file
2
tests/wrappers/fixtures/ci-skip001.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
wrappers:
|
||||
- ci-skip
|
Loading…
Reference in New Issue
Block a user