[HAP-1117] Artifact promotion plugin should support running some custom code Created: 07/Dec/18  Updated: 02/Jul/19  Resolved: 03/Jan/19

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: None
Affects Version/s: 2.16.2
Fix Version/s: 3.0.0

Type: New Feature Priority: Normal
Reporter: Sushant Pradhan Assignee: Eyal Ben Moshe
Resolution: Fixed Votes: 0
Labels: artifactory, jenkins, promotion


 Description   

Artifact promotion plugin should support running some custom code after successfully promoting a build

https://www.jfrog.com/confluence/display/RTF/Working+With+Pipeline+Jobs+in+Jenkins#WorkingWithPipelineJobsinJenkins-AllowingInteractivePromotionforPublishedBuilds



 Comments   
Comment by Eyal Ben Moshe [ 08/Dec/18 ]

The upcoming Jenkins Plugin version will support triggering Jenkins jobs following changes in Artifactory. Jenkins will poll an Artifactory path (definined in the job configuration) and will trigger the build, if files are added to this path. This will be supported for pipeline jobs.

Comment by Sushant Pradhan [ 08/Dec/18 ]

Thank you Eyal. Do you have any rough timeline for when the new version will be released?

Comment by Eyal Ben Moshe [ 08/Dec/18 ]

We are aiming to release this at the end of this month.

Comment by Sushant Pradhan [ 03/Jan/19 ]

Hello Eyal Ben Moshe. I see version 3.0.0 released 2 days back has a Jira issue HAP-1012 fixed which seems similar to the one here. 

Can you confirm if it is done and guide me to the documentation around the configuration and pipeline changes required for me to trigger a jenkins job on pushing/moving a artifact in artifactory.

 

Comment by Eyal Ben Moshe [ 03/Jan/19 ]

With version 3.0.0 of the Jenkins Artifactory Plugin installed, you'll see a new "Enable Artifactory Trigger" option under "Build Triggers" in each Jenkins job.

This is the way you can currently trigger custom code following changes in Artifactory. The custom code can be configured, as part of a pipeline job. The job will be triggered following the addition or modification of files in the configured Artifactory path. Promotion actually adds or modifies files in a specific path, so that's how you get this functionality going with the new Artifactory Trigger feature.

Comment by Sushant Pradhan [ 03/Jan/19 ]

Thank you for confirmation. Does the plugin prepopulate some variable with new binary/artifact name/path? Basically after the job is triggered, how can I know what was the artifact which triggered it?
Also is it recursive scan on the passed folder or just at the current folder?

Comment by Sushant Pradhan [ 28/Jun/19 ]

Eyal Ben Moshe does the Artifactory Build Trigger has pipeline support? Can you give me sample or point me to the documentation please

Comment by Eyal Ben Moshe [ 02/Jul/19 ]

The "Enable Artifactory trigger" option is available for pipeline jobs as well.

Generated at Sun Jan 19 11:15:56 UTC 2020 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.