Vary build behavior depending on dependent build success / failure (ie, query dependent job)
Hi - I have JobA which has a snapshot dependency on JobB. The dependency is set such that JobA will run regardless of whether JobB fails or succeeds.
However, I would like JobA to perform differently depending on whether JobB succeeds or fails - ie, I need to query whether JobB failed from within JobA.
Are there any facilities in TeamCity to make this easier? ie, parameters that I can use to query the state of dependent jobs? Or do I have to use the REST API? If I need to use the REST API, can anyone give me a quick pointer to where I should be looking? Thanks!
Please sign in to leave a comment.
I'm afraid not directly, but it should be reasonable to apply. There is a wide set of parameters that you can reference via %dep..%. You can use the build id for example to retrieve the build status from our REST API.
Would it be possible to share more details on the use case? It might make more sense to have two separate build configurations for the two different cases to avoid script complexity.