Dependency chain: Run specific build after one of many dependencies

Sorry, I couldn't think of a good way to format the title.

I have a large number of builds. They're all based off the same template, and they all produce roughly similar artifacts. Let's call them A1, A2, A3, etc.

I have another build which post-processes the artifacts from A1, A2, A3. Let's call it 'B'.

I'd like B to run after any successful build of A*. B only needs the artifacts from that build, not all of them. In fact, to retrieve artifacts from all of the 'A' builds would take a prohibitively long time.

I can't run B as an additional build step in the template because it requires an agent that is incompatible with the ones that can run A builds.

The A builds don't necessarily run off the same VCS (in fact, usually they don't.)

Am I right in thinking that the only way I can achieve this is to have a B build for every A build? I couldn't find a way using snapshot or artifact dependencies to have just one B build that runs after every A, using only that build's artifacts.

1
1 comment

Hi Simon,

You are right in your thinking, it's not the only way but it's currently the best. It also allows you to better debug when something goes wrong with B. In case anything fails in B, you need to investigate deeper which of the As had been used, while setting up a separate B for each allows you to know exactly which one of all the processes has failed.

This said, there might be another way to do it, that would still require some tinkering: Create a parameter for B that holds the artifact name. Extend A to store the artifact somewhere that would be available for B to pick up. Then, at the end of A, add an additional step that triggers a build of B, passing the artifact name as the parameter. Then B can pick up this artifact and process it as needed.

As mentioned, the recommended way is the first one, as it makes everything much easier to track should there be any issue.

-1

Please sign in to leave a comment.