2

I have a build stage as shown below with two build jobs, a frontend and a backend job. How do I directly access the Build Archive Directory of the frontend job from the backend job's build script?

I need to access the frontend build artifacts in order to properly build the final archive. And I can see all the artifacts show up in the Artifacts tab for the frontend build. But how do I access that from the second job, i.e. backend build?

I saw here that there is an Environment variable to access the current job's archive dir, but I need to access the other jobs archive dir.

enter image description here

Dave L.
  • 9,595
  • 7
  • 43
  • 69

1 Answers1

1

Currently, both jobs inside a stage are run in complete separate environments. They do not have access to the artifacts of the other jobs in the stage. The way to get around this is to create a new stage for the 'backend' job, and then set the input for that stage to be the build artifacts from the 'frontend' job

crjenkins89
  • 421
  • 2
  • 4
  • Yeah that's what I did. I was also considering issuing a `curl` command from the second job (i.e. `https://$USERNAME:$PASSWORD@hub.jazz.net/pipeline/////latest?download=all`) and fetching the artifacts from the first job that way. Do you think that would work? – Dave L. Aug 25 '15 at 15:30
  • 1
    @david - You should be able to use curl to get the artifacts, although, I have not done it myself. This is the url you will want to hit: `https://hub.jazz.net/pipeline//download///latest` – crjenkins89 Aug 27 '15 at 12:35
  • Do you have any updated info for IBM BlueMix? Jazz is not available anymore. – Nam Vu Sep 26 '17 at 16:44