I want to setup a job which promotes an artifact from say integration repo in artifactory to staging repo in artifactory based on the result of another job. Even if there is a solution to promote as a post build action based on result of the current job, it would suffice my requirement.
Asked
Active
Viewed 843 times
1
-
Have you considered making the second job a "downstream" job of the first one? I believe that would create some inheritance. – dokun1 Mar 08 '16 at 12:27
-
Do you mean in the second job I should pull the artifact from first repo and then push it to second repo by using artifactory plugin? I can try this was wondering if there is a better way to do it. – Max Mar 08 '16 at 12:48
-
I don't think you would need artifactory or any kind of plugin for this. If you set your target job to be downstream of your starter job, you can pass the environment variables as parameters to the next job. This should be native in jenkins without any plugins :) – dokun1 Mar 08 '16 at 12:53
1 Answers
4
You can use Artifactory's Build Promotion API and promote a build into a different repository each time with a different status.
So basically have a downstream Jenkins job that calls this API after a build has met your quality requirements (i.e. tests completed successfully).
The Jenkins Artifactory plugin has very extensive functionality for promotion by itself as well.

danf
- 2,629
- 21
- 28