How to Trigger Jenkins Builds When Deploying Artifacts

JFrog Support
2023-01-22 11:09

If you want to trigger a Jenkins build when you’re deploying artifacts, there’s aJenkins pluginavailable to help you to do this. CalledURLTrigger, it can be configured towatch for specific changestaking place within designated URLs. When changes occur, they’ll initiate the build trigger.

For example, you can configure URLTrigger to watch for changes in the JSON file that is produced from thefile listREST API, which can be accessed via the following URI:

http://localhost:8081/artifactory/api/storage//

The plugin periodicallypollsfor changes within this URL and triggers a build if two consecutive calls return different JSONs (they’ll be different if a new artifact has been deployed).

Note: Be sure to fill in yourcredentialsin the plugin’s configuration settings. This will allow it to execute anauthenticationevery time it submits a request to the file list.