Merge "Update FSTrigger plugin"
This commit is contained in:
commit
64355ba426
|
@ -1346,35 +1346,44 @@ def monitor_folders(registry, xml_parent, data):
|
||||||
Requires the Jenkins :jenkins-wiki:`Filesystem Trigger Plugin
|
Requires the Jenkins :jenkins-wiki:`Filesystem Trigger Plugin
|
||||||
<FSTrigger+Plugin>`.
|
<FSTrigger+Plugin>`.
|
||||||
|
|
||||||
:arg str path: Folder path to poll. (optional)
|
:arg str path: Folder path to poll. (default '')
|
||||||
:arg list includes: Fileset includes setting that specifies the list of
|
:arg list includes: Fileset includes setting that specifies the list of
|
||||||
includes files. Basedir of the fileset is relative to the workspace
|
includes files. Basedir of the fileset is relative to the workspace
|
||||||
root. If no value is set, all files are used. (optional)
|
root. If no value is set, all files are used. (default '')
|
||||||
:arg str excludes: The 'excludes' pattern. A file that matches this mask
|
:arg str excludes: The 'excludes' pattern. A file that matches this mask
|
||||||
will not be polled even if it matches the mask specified in 'includes'
|
will not be polled even if it matches the mask specified in 'includes'
|
||||||
section. (optional)
|
section. (default '')
|
||||||
:arg bool check-modification-date: Check last modification date.
|
:arg bool check-modification-date: Check last modification date.
|
||||||
(default true)
|
(default true)
|
||||||
:arg bool check-content: Check content. (default true)
|
:arg bool check-content: Check content. (default true)
|
||||||
:arg bool check-fewer: Check fewer or more files (default true)
|
:arg bool check-fewer: Check fewer files (default true)
|
||||||
:arg str cron: cron syntax of when to run (default '')
|
:arg str cron: cron syntax of when to run (default '')
|
||||||
|
|
||||||
Example:
|
Full Example:
|
||||||
|
|
||||||
.. literalinclude:: /../../tests/triggers/fixtures/monitor_folders.yaml
|
.. literalinclude::
|
||||||
|
/../../tests/triggers/fixtures/monitor-folders-full.yaml
|
||||||
|
:language: yaml
|
||||||
|
|
||||||
|
Minimal Example:
|
||||||
|
|
||||||
|
.. literalinclude::
|
||||||
|
/../../tests/triggers/fixtures/monitor-folders-minimal.yaml
|
||||||
|
:language: yaml
|
||||||
"""
|
"""
|
||||||
ft = XML.SubElement(xml_parent, ('org.jenkinsci.plugins.fstrigger.'
|
ft = XML.SubElement(xml_parent, ('org.jenkinsci.plugins.fstrigger.'
|
||||||
'triggers.FolderContentTrigger'))
|
'triggers.FolderContentTrigger'))
|
||||||
path = data.get('path')
|
ft.set('plugin', 'fstrigger')
|
||||||
if path:
|
|
||||||
XML.SubElement(ft, 'path').text = path
|
mappings = [
|
||||||
includes = data.get('includes')
|
('path', 'path', ''),
|
||||||
if includes:
|
('cron', 'spec', ''),
|
||||||
XML.SubElement(ft, 'includes').text = ",".join(includes)
|
]
|
||||||
excludes = data.get('excludes')
|
convert_mapping_to_xml(ft, data, mappings, fail_required=True)
|
||||||
if excludes:
|
|
||||||
XML.SubElement(ft, 'excludes').text = excludes
|
includes = data.get('includes', '')
|
||||||
XML.SubElement(ft, 'spec').text = data.get('cron', '')
|
XML.SubElement(ft, 'includes').text = ",".join(includes)
|
||||||
|
XML.SubElement(ft, 'excludes').text = data.get('excludes', '')
|
||||||
XML.SubElement(ft, 'excludeCheckLastModificationDate').text = str(
|
XML.SubElement(ft, 'excludeCheckLastModificationDate').text = str(
|
||||||
not data.get('check-modification-date', True)).lower()
|
not data.get('check-modification-date', True)).lower()
|
||||||
XML.SubElement(ft, 'excludeCheckContent').text = str(
|
XML.SubElement(ft, 'excludeCheckContent').text = str(
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<project>
|
<project>
|
||||||
<triggers class="vector">
|
<triggers class="vector">
|
||||||
<org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger>
|
<org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger plugin="fstrigger">
|
||||||
<path>pathname</path>
|
<path>pathname</path>
|
||||||
|
<spec>H/15 * * * *</spec>
|
||||||
<includes>pattern1,pattern2</includes>
|
<includes>pattern1,pattern2</includes>
|
||||||
<excludes>pattern1</excludes>
|
<excludes>pattern1</excludes>
|
||||||
<spec>H/15 * * * *</spec>
|
|
||||||
<excludeCheckLastModificationDate>true</excludeCheckLastModificationDate>
|
<excludeCheckLastModificationDate>true</excludeCheckLastModificationDate>
|
||||||
<excludeCheckContent>true</excludeCheckContent>
|
<excludeCheckContent>true</excludeCheckContent>
|
||||||
<excludeCheckFewerOrMoreFiles>true</excludeCheckFewerOrMoreFiles>
|
<excludeCheckFewerOrMoreFiles>true</excludeCheckFewerOrMoreFiles>
|
|
@ -2,10 +2,10 @@ triggers:
|
||||||
- monitor-folders:
|
- monitor-folders:
|
||||||
path: 'pathname'
|
path: 'pathname'
|
||||||
includes:
|
includes:
|
||||||
- 'pattern1'
|
- 'pattern1'
|
||||||
- 'pattern2'
|
- 'pattern2'
|
||||||
excludes: 'pattern1'
|
excludes: 'pattern1'
|
||||||
check-modification-date: false
|
check-modification-date: false
|
||||||
check-content: false
|
check-content: false
|
||||||
check-fewer: false
|
check-fewer: false
|
||||||
cron: 'H/15 * * * *'
|
cron: H/15 * * * *
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<triggers class="vector">
|
||||||
|
<org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger plugin="fstrigger">
|
||||||
|
<path/>
|
||||||
|
<spec/>
|
||||||
|
<includes/>
|
||||||
|
<excludes/>
|
||||||
|
<excludeCheckLastModificationDate>false</excludeCheckLastModificationDate>
|
||||||
|
<excludeCheckContent>false</excludeCheckContent>
|
||||||
|
<excludeCheckFewerOrMoreFiles>false</excludeCheckFewerOrMoreFiles>
|
||||||
|
</org.jenkinsci.plugins.fstrigger.triggers.FolderContentTrigger>
|
||||||
|
</triggers>
|
||||||
|
</project>
|
|
@ -0,0 +1,2 @@
|
||||||
|
triggers:
|
||||||
|
- monitor-folders
|
Loading…
Reference in New Issue