How to launch Jenkins on a new artifact in Artifactory?

Can Artifactory be used as "SCM" or a source in Jenkins to initiate assembly on a particular artifact deployment?

Do not see (or skip) anything similar in the Artifactory Jenkis plugin description ( and on Jenkins side )

This may be required, for example, if you have access to the Artifactory repository, and not to SCM with the code from which the binary files originate.

This functionality seems to be available for Nexus (via the nexus-webhook-plugin ). It's hard to believe that this feature is missing for Artifactory.

+9
source share
3 answers

It may not be as elegant as a trap, but I believe that the URLTrigger plugin will achieve what you are looking for. Listed in their use cases:

This plugin allows users to check whether new artifacts (such as binary files) have been deployed to a repository (managed, for example, by a repository manager such as Sonatype Nexus, JFrog Artifactory, Apache Archiva, etc.).

This allows you to check the date of the last change and check the content of the response for changes.

You will need to use the polling interval instead of relying on Artifactory to notify Jenkins through the hook, but in my experience, polling is relatively harmless even with a large number of polls at large intervals.

+6
source

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

Go to Build Triggers and check the Enable Artifact box .

enter image description here

Learn more about GitHub support for the Artifactory trigger.

0
source
How to detect the artifactory trigger? like for timeTrigger scmCause = upStreamBuild.getCause(hudson.triggers.SCMTrigger.SCMTriggerCause) if (scmCause != null) { return scmCause.getShortDescription() } //Check if the build was triggered by timer timerCause = upStreamBuild.getCause(hudson.triggers.TimerTrigger.TimerTriggerCause) if (timerCause != null) { return timerCause.getShortDescription() } //Check if the build was triggered by some jenkins user usercause = upStreamBuild.getCause(hudson.model.Cause.UserIdCause.class) if (usercause != null) { return usercause.getUserId() } 
0
source

All Articles