A first job 'jobA' polls a SCM tool and schedules a build if there is at least one change.
The build instantiates a build process, produces artifacts (binaries, text output, ...) and deploys these artifacts in a target filesystem.

A second job 'jobB' checks the existance of the new artifacts in the target filesystem. If there is a change, 'jobB' is scheduled.
'jobB' may provide packaging steps, testing steps or other steps of a pipeline.

Both jobs are independents and listen external events.

Other similar plugins

* If you want just to know if a set of files exists and display the number of files found, you can use Files Found Trigger plugin.

Known Limitations

The current code is written in Java and it is not very optimized. For example, we can't get similar performance as with Python. Therefore, we recommend to not use FSTrigger plugin when you want to poll a directory with a large set of files.

Release 0.2

Release 0.1

24 Comments

I like to process large amount of media files with Jenkins. It would be really nice to trigger this build with this plugin, but I discovered that scanning part of this plugin takes a lot of cpu power and blocking requests to jenkins when scanning large files. Is there a way to let this plugin only scan for the last change date and not for the actual content? Or build in a option to do this? That would be really helpful.

You have to use '[FS Trigger] - Monitor files'.
You give them a file path. And don't check the checkbox 'Inspect the contents'.
With this configuration, the fstrigger plugin should not scan file content and schedule a build only if the last modification date of the file has changed.

Can the FS Trigger - Monitor Files be a unix soft link? It does not seem to be working. The trigger says nothing changed. Is there a file somewhere that stores the info for this trigger so I can debug?

When the plugin encounters an error (for example, when it runs into "permission denied"), it posts a message into the polling log and exits silently. If an administrator doesn't check the log regularly, the build will never be run.

I see no clean way of solving this, but I believe this to be a major issue.

I am having an xml file(executeRM.xml) with contents as mentioned below.<r1> <n1 name="component1" version="14.0" state="ToBeInstalled"/> <n2 name="Component2" version="13.0" state="Installed"/> <n3 name="Component3" version="12.0" state="TobeInstalled"></r1>I have used "FS trigger-Monitor files" and is an every one minute schedule, where I have given the full path of the above xml file. Now I want to write an xpath query, which will trigger the job only when state will be "ToBeInstalled" for any of the 3 components or all. I have written the below xpath query, but the job itself is not getting triggered.
/r1/n1@name='Component1' and @state='ToBeInstalled' /r1/n2@name='Component2' and @state='ToBeInstalled' /r1/n3@name='Component3' and @state='ToBeInstalled'
At any point of time if any one or all three(it may get increased to 6-7) conditions hold good then I should be able to trigger the build.
If I use /r1/n1/@state, multiple build get triggered. So either I have to use the proper Xpath query or should use some other trigger mechanism.
Please suggest me if I can play with xpath queries or better go for some other method. But the XML structure remains constant,
I may have to add few nodes, but the attributes remain the same. For any component, if the attribute value is "ToBeInstalled", build should get triggered.

[FSTrigger] - Monitor files

Polling started on Oct 31, 2018 4:50:00 PM
Polling for the job kudos-upgrade
Looking nodes where the poll can be run.
Looking for a candidate node to run the poll.
Looking for a node with no predefined label.
Trying to poll with the last built on node.
Polling on master.
There is no matching files in the folder '/var/jenkins_home/jobs/upgrade/workspace' for the fileName 'upgrade.START'.
Checking one file: '/var/jenkins_home/jobs/download/workspace/LATEST'.
The computed file doesn't exist.
Polling complete. Took 3 ms.
No changes.

Note that I see that if a file changes during a jenkins restart (or just before a jenkins restart if the FSTriggered job is running) then the FSTrigger doesn't detect a change in the file.

I see issue "JENKINS-12924 - FSTrigger triggers builds on jenkins restart" I guess this behaviour is on purpose, normal case is that jenkins is continuously running and jobs will be triggered on any file changes that happen.