Child pages
  • URLTrigger Plugin
Skip to end of metadata
Go to start of metadata

Plugin Information

View URLTrigger on the plugin site for more information.

URLTrigger plug-in makes it possible to monitor changes of the response got from an URL invocation.

Features

Jenkins can be configured to poll URL changes.
The plug-in makes it possible to check the last modification date response and the response content of an URL invocation.
For the response content, you can check:

  • a simple response content (the content nature is not interpreted; a MD5 is used)
  • a TXT response content (the returned values from the evaluation of regular expressions are checked)
  • an XML response content (the returned values from the evaluation of XPath expressions are checked)
  • a JSON response content (the returned values from the evaluation of JSONPath expressions are checked)

Note: The plug-in uses only persistence in memory. There is no impact on the Jenkins infrastructure (no new files created).
This plugin provides a polling typology among the XTrigger Plugin.

Some Use cases

* This plugin enables users to check if new artifacts (such as binaries) have been deployed in a repository (managed for example by a repository manager such as Sonatype Nexus, JFrog Artifactory, Apache Archiva and so on).
* This plugin is useful to know if a stage of a pipeline (for a continuous testing, a continous delivery or a continuous deployment) has to be executed.

Known Limitations

Only http(s) URLs are supported. For non-http protocols, consider other XTrigger plugins such as the FSTrigger Plugin

Configuration

Comparison with similar plugins

This plugin supports all URL Change Trigger features and it includes all the fixes of the current URL Change Trigger issues.
And unlike the URL Change Trigger, URLTrigger plug-in is also able to check the content nature (TEXT, XML, JSON) of a file.
Additionally the plugin can be extended (in the same plugin or by an other plugin) to check other content type.

Changelog

Release 0.42

Tidied URL verification and removed unnecessary url GET.

Release 0.41

* allow to use jsonarray as root of input message

Release 0.40

* Fix JENKINS-28834 - Declare dependency on matrix project plugin

Release 0.39

* Fix JENKINS-29610 - Scheduling skipped when there is no label restriction (trigger-lib 0.33)
* Fix JENKINS-20712 - ETag/MTime saved in config.xml but there is no flag in job web page

Release 0.38

* Assign meaningful name to executor thread
* Be more explicit about failed content check preconditions

Release 0.37

* Fix JENKINS-20359 - Monitoring URL for JSON content change not working

Release 0.36

* Making the build compatible with Java 7

Release 0.35

* Fix JENKINS-17961 - URLTrigger does not poll when URL starts with environment variable

Release 0.34

* Fix JENKINS-18035 - Request to support HTTPS url monitoring in URLTrigger plugin

Release 0.33

* Fix regression on polling log from previous version

Release 0.32

* Fix JENKINS-18683 - Jenkins 1.522 config changes cannot be saved
* Fix JENKINS-18764 - NPE in URLTrigger when saving project configuration

Release 0.31

* Fix JENKINS-17641 - Unknown field 'logEnabled' in org.jenkinsci.lib.xtrigger.XTriggerCause

Release 0.30

* Fix JENKINS-17468 - NullPointerException in URLTrigger.getFTPResponse during startup

Release 0.29

* Add FTP Support

Release 0.28

* Fix JENKINS-16774 - URLTrigger gives severe error message instead of detecting change

Release 0.27

* warn user that only http is supported for URL protocol (added by ndeloof)

Release 0.26

* Fix JENKINS-14620 - Invalid configurations

Release 0.25

* Fix JENKINS-15564 - URLTrigger: Allow timeouts to be configurable

Release 0.24

* Fix JENKINS-14607 - URLTrigger "Polling error null"

Release 0.23

* Add the capability to check ETag response header

Release 0.22

* Add JENKINS_URL resolution at startup check
* Update to xtrigger-lib 0.17
* Update to envinject-lib 1.10

Release 0.21

* Add environment variables resolution at the trigger startup lifecycle
* Update to xtrigger-lib 0.16
* Update to envinject-lib 1.9

Release 0.20

* Upgrade to xtrigger-lib 0.14 (more log)

Release 0.19

* Restrict to successful family for URL content
* Exclude polling on unavailable services

Release 0.18

* Fix job restart when JENKINS URLs to check are unavailable at Jenkins startup

Release 0.17

* Update to xtrigger-lib 0.12 (fix link to polling log to appear on build console)

Release 0.16

* Fix TXT content type detection

Release 0.15

* Fix JENKINS-12912 - URLTtrigger does not poll on jobs which are tied to disconnected slaves

Release 0.14

* Update to xtrigger-lib 0.8

Release 0.13

* Fix the hang problem (JENKINS-12696)

Release 0.11

* Update to xtrigger-lib 0.7

Release 0.10

* Update to xtrigger-lib 0.2
* Fix JENKINS-12213 - Polling error org/jenkinsci/plugins/envinject/EnvInjectAction" when monitoring build number url

Release 0.9

* Fix JENKINS-11859 - java.io.IOException: Stream closed" when monitoring a jenkins job build number

Release 0.8

* Environment variables are taken into account

Release 0.7

* Add proxy configuration if needed

Release 0.6

* Fix JENKINS-11273 - Basic Authentication support in urltrigger

Release 0.5.1

* Fix TXT Content type saving

Release 0.5

* Change 'Add Button' label
* Fix JENKINS-10731 - XMLContentType didn't update initial results HashMap
* Fix JENKINS-10728 - URLTrigger, config.jelly and checkLastModificationDate should be optionalBlock

Release 0.4.3

* Add message when there are no URLs to poll

Release 0.4.2

* Fix NullPointerException when there is no URL entry

Release 0.4.1

* Fix a NullPointerException at Jenkins startup
* Add a delete button on the configuration page to remove an entry section

Release 0.4

* Add Text Content check

Release 0.3

* Add JSON content check
* Technical features: additional unit tests

Release 0.2

* Add poll changes of URL contents

Release 0.1

* Initial release

25 Comments

  1. Hi! 
    Can you please explain how the 'Inspect URL content' option works ? I'd like to monitor some URL and trigger build of it's content changed (all the text except one particular line). So I tried to use regex with your plugin, but can't understand how it works, and is it possible to do so or not ?

    Example: 

    -------------------------------
    time1: URL html content :

    black dog
    white cat
    red cow
    

    -------------------------------
    time2: URL html content :

    black dog
    green cat
    red cow
    

    -------------------------------
    And I'd like to trigger build ONLY if 'black dog' line or 'red cow' line have been changed between two polls.

    Thank you in advance.

    1. It is not possible to make it for now.
      I have to enhance the plugin.
      Could you report a bug in the issue tracker?

    2. After study, It will be not possible to cover this problematic.
      Regular expression in URLTrigger will inspect content line by line.

  2. Can support for build parameters/variables in URL text field be added?

    1. It already should be the case.
      If it is not work in your context, please fill in a bug report.

  3. Would it be possible to implement a verbose/debug mode?  I'm attempting to use the TXT content & regexp trigger, but am not 100% confident that the regular expression I'm using is correctly handling the URL content.  If I could see what exactly my regexp results are, that'd be a great help.

    1. A bit difficult in this context.
      However, there are lot of online platforms to test your regular expressions against a text.

  4. Hi,

    Is it possible execute pooling on slaves? Now I've got this error:Looking nodes where the poll can be run.
    Looking for a node to the restricted label wrling20.
    Can't find any eligible nodes.
    Trying to poll on master node.
    Can't find any complete active node for the polling action.
    Maybe slaves are not yet active at this time or the number of executor of the master is 0. Even option "restrict where the polling can be run" doesn't help.

    1. With URLTrigger, you are able to select a specific node. Therefore, it is possible to execute a poll on a slave node.
      However, your node has to be online. URLTrigger doesn't active the node for the poll.
      I have difficulty giving you a suitable answer because it depends on the context and it is complex to reproduce.
      Maybe there is an issue on the plugin, please could try to give more information and isolate the issue?

      1. Hi,

        Thank you for quick reply. Recently I've noticed something strange, but I don't know why when I add login and password to authenticate then it's fail during searching active node, but then I turn authentication off it's pool normaly. Once again thank you. Now it's time to solve issues with artifacts.

        Br,

        Marcin

        1. OK, if you or other people have again issues with authentication, do not hesitate to raise a new issue.

  5. Hi, does the plugin support monitoring HTTPS urls? Thanks.

    1. URL Trigger does not support for now HTTPS.
      However, it supports HTTP URL and it is able to use the configured Jenkins proxy.

      It need investigation for adding this new feature.
      Please raise a new issue in the Jenkins issue tracker.

      1. Hi, Thanks for your quick response. Here is the issue raised:

        https://issues.jenkins-ci.org/browse/JENKINS-18035

  6. I'm trying a parameterized URL trigger:

    URL = http://localhost:8081/artifactory/libs-release-local/$school/dist-$school/$version/ivys/ivy-$version.xml

    with build parameters

    Unfortunately the log shows this:Polling started on 8-Sep-2013 5:55:10 PM
    Polling for the job Ivy trigger build
    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.
    Trying to poll on master node.

    Polling on master.
    Invoking the url:
    http://localhost:8081/artifactory/libs-release-local/$school/dist-$school/$version/ivys/ivy-$version.xml

    Can anyone point out what I'm doing wrong?

    1. I have the same problem. What *does* work (I think!) is if there is only one parameter name, at the end of the URL. So this would work:

      http://blah/blah/$value

      So possibly you can create another variable based on your parameters, and use that there. But so far, I haven't had any success with that either.

      Gregory, is there a way to do this, or should we file a feature request for it? Ideally, I too would just like to be able use parameters directly, as Omair asked.

  7. Hi,

    sorry for duplicated question..

  8. Hi,
    I'm trying to trigger my Jenkins job when monitored Bamboo job successfully finished.
    Idea is simple - using Bamboo API, I can obtain number of last successfull job.
    Unfortunately my job is trigerred every time, regardless of Bamboo job number change.
    There is no authorization necessary. 
    I also tested my xpath at http://www.freeformatter.com/xpath-tester.html. 
    It returns e.g. Text='90', which looks fine.
    Any idea what I'm doing wrong?
    Thanks!

  9. I'm trying to use this plugin, URLTrigger, and I can't seem to see how I can find out which resource triggered the build.

    I have several external resources for my build that I am monitoring via URLTrigger and it would be very helpful to know WHICH ones caused my build to trigger.

    Is there any way to know which URLTrigger-monitored resource triggered the build?

    If not, is there a better way to do this? (monitor several external resources, and schedule a build when one of them changes).

    Thanks.

  10. Is there any way to determine what change this plugin detected?

    I am attempting to debug a use of this plugin where it seems to randomly decide that the page it is polling has changed, although I cannot determine any change on the page it is polling.

    1. Disregard this, the issue was resolved and was not due to this plugin.

  11. Hi,

    Is there any chance the use of parameters in the URL can be made more reliable?  For example, I have a global property set up under 'manage jenkins' called RELEASE, which points to the current major release number.

    If I set URLTrigger to poll our local nexus repo for artifact changes: ( http://nexushost/nexus/content/repositories/snapshots/group/MY_PROJECT/${RELEASE}-SNAPSHOT/maven-metadata.xml ) I can then set an xml path to monitor for snapshot uploads.

    This will generally work, up until the definition of RELEASE is changed in global properties.  At that point, some jobs will poll the new URL, others will continue to poll the old one.  I haven't been able to figure out why yet.

     

    1. To follow-up:

      This is due to the use call to getPollingEnvVars in envinject-lib when resolving parameterised URLs, which will always use the environment variables as at the time of the last build in preference to the global defaults.  The effect of this is that once the job has been triggered and run, it will continue to use the same variable definitions, regardless of any changes that take place in the meantime (until a manual run is triggered).

      This doesn't seem like correct functionality for the purpose - would it be better to use getDefaultEnvVarsJob() instead?

  12. Will this plugin work to monitor Artifactory?

    Not sure if i didnot configure properly but here is what i did.

    Installed plugin and in the job, selected it and entered the url - Lets say - https://jfrog.com/artifactory/myrepo/

    I need to trigger jenkins job whenever some file is added or updated.

    I configured the above url in URL section of the plugin and checked in "check the last modified Date"

    I added a text file to the repo multiple times  but seems like it is not working. Please let me know if i need to configure in any other way

     

  13. From what I've seen, modification time checks only work reliably with the ftp protocol.

    When checking Nexus, Artifactory, or similar, I find the best approach is to check the metadata - either for overall content change, or a specific xpath / json path.

Write a comment…