Reputation: 925
I have two Jenkins jobs.
Job 1: Uploads build to artifactory
Job 2: Downloads build from artifactory and does some stuff with it
Right now, Job 1 triggers Job 2 using the Parameterized Build Plugin (Job 2 is shared amongst many teams at my company, so I don't want to change it too much - it's a parameterized job that takes an artifactory URL)
The problem is, it seems like the artifact doesn't always finish uploading to artifactory before Job 2 is triggered. Sometimes Job 2 gets a 404 when it tries to download the artifact. Is there some way to 1) prevent triggering Job 2 until the artifact has uploaded? or 2) pass the artifact directly from Job 1 to Job 2 w/out needing to do an upload and a download? (the former would be preferable, since option 2 would require changing Job 2)
Upvotes: 2
Views: 1832
Reputation: 10382
Regarding your option 1, you can use the Naginator plugin to reschedule a job 2 if it fails.
Regarding the option 2, you can use the Copy Artifact plugin. It will allow the job 2 to copy the artifacts from the job 1.
Personally, I prefer the option 1. Artifactory is the right place to store binaries :)
There is a 3rd solution by using the quiet period setting on the job 2 to delay the start (Jenkins: build one job after another with some delay).
Upvotes: 3