Merge "fix default handling of script-file-path"

This commit is contained in:
Jenkins
2015-12-03 05:04:39 +00:00
committed by Gerrit Code Review
5 changed files with 27 additions and 4 deletions

View File

@@ -1458,7 +1458,7 @@ def script(parser, xml_parent, data):
:arg str label: Restrict where the polling should run. (default '')
:arg str script: A shell or batch script. (default '')
:arg str script-file-path: A shell or batch script path. (default '')
:arg str script-file-path: A shell or batch script path. (optional)
:arg str cron: cron syntax of when to run (default '')
:arg bool enable-concurrent: Enables triggering concurrent builds.
(default false)
@@ -1477,8 +1477,9 @@ def script(parser, xml_parent, data):
label = data.get('label')
XML.SubElement(st, 'script').text = str(data.get('script', ''))
XML.SubElement(st, 'scriptFilePath').text = str(
data.get('script-file-path', ''))
if 'script-file-path' in data:
XML.SubElement(st, 'scriptFilePath').text = str(
data.get('script-file-path'))
XML.SubElement(st, 'spec').text = str(data.get('cron', ''))
XML.SubElement(st, 'labelRestriction').text = str(bool(label)).lower()
if label:

View File

@@ -3,7 +3,6 @@
<triggers class="vector">
<org.jenkinsci.plugins.scripttrigger.ScriptTrigger>
<script>exit 0</script>
<scriptFilePath/>
<spec>H/15 * * * *</spec>
<labelRestriction>true</labelRestriction>
<triggerLabel>master</triggerLabel>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<triggers class="vector">
<org.jenkinsci.plugins.scripttrigger.ScriptTrigger>
<script>exit 0</script>
<scriptFilePath>$WORKSPACE/scripts</scriptFilePath>
<spec>H/15 * * * *</spec>
<labelRestriction>true</labelRestriction>
<triggerLabel>master</triggerLabel>
<enableConcurrentBuild>false</enableConcurrentBuild>
<exitCode>0</exitCode>
</org.jenkinsci.plugins.scripttrigger.ScriptTrigger>
</triggers>
</project>

View File

@@ -0,0 +1,9 @@
triggers:
- script:
script: 'exit 0'
script-file-path: '$WORKSPACE/scripts'
cron: 'H/15 * * * *'
enable-concurrent: False
label: master
exit-code: 0