I'm currently new to Jenkins and there is a situation, where I would like to create a set of Jenkins jobs with the following flow:
A -> B -> C
To give you context, I have Job A (Which is designed as an initialiser to grab the results of Jobs B and C together in 1 artifact), Job B (takes the results of Job C, CSS and JS files and builds them into a war file, with other required files) and Job C (which builds minified CSS and JS files for a particular customer. Each build will pass in different customers as a parameter)
Normally I would be able to use the Parametrized Trigger, Copy Artifact and Build Name Setter I could Run Job A which triggers Job B and in turn Triggers Job C which the output of Jobs B and C would be the output of the subsequent upstream job. So theoretically in the end in Job A I would receive the output of Job B.
I have tried inserting ${TRIGGERED_BUILD_NUMBER_JOB_C} in build A when we are copying artifact for Job C under 'Specific Build' of the copy artifact plugin, however, the error that I get is:
Copied 1 artifact from "JOB_B" build number 15 ERROR: Unable to find a build for artifact copy from: JOB_C
I've seen other settings under the copy artifact plugin such as "Downstream build of" or "Upstream is a trigger of" but I'm not sure on the specifics in what they do or whether or not these are the settings that will achieve what I need.
Furthermore, I could've done 'Last Successful Build' on Job C, however, I fear that if there are multiple people running job C at close to the same time, they would end up getting the wrong build as each CSS and JS build can be for a different customer.
So rather than continue and knocking my head, I was wondering this is possible and what would be the steps I need to get this flow?
Thanks.
I have tried inserting ${TRIGGERED_BUILD_NUMBER_JOB_C} in build A: If A triggers B triggers C, then A does not have access to trigger parameters of C, just of B. This would only work when all involved builds have the same number. - Stefan Hanke