How to trigger a Jenkins build on a new artifact i

2020-07-05 07:19发布

问题:

Can Artifactory be used as "SCM" or source in Jenkins to trigger the builds on an particular artifact deploy?

Don't see (or miss it) anything similar in the Artifactory Jenkis plugin description (and on Jenkins side)

This could be needed for instance if there is only access to the Artifactory repository and not to the SCM with code the binaries are coming from.

Such functionality looks to be availble for Nexus (via nexus-webhook-plugin). Hard to believe that this feature is missing for Artifactory.

回答1:

Now you can use Enable Artifactory trigger in a newer version.

Go to Build Triggers and check the Enable Artifactory trigger checkbox.

More Detail on GitHub Support for Artifactory trigger



回答2:

It's maybe not as elegant as a hook, but I believe the URLTrigger Plugin will achieve what you're looking for. Listed in their 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).

It allows you to check the last modification date and inspect the contents of the response for changes.

You would have to use a polling interval instead of relying on Artifactory to notify Jenkins via a hook, but in my experience polling is relatively innocuous even with lots of polls at high intervals.