Question
- There are two build configurations:
buildAandbuildB. - The new build of
buildBshould be triggered only when the build ofbuildAfails.
Is it possible to achieve this scenario?
Answer
There is no built-in functionality to trigger the build of the build configuration buildB only if the build of the configuration buildA failed.
To achieve a similar logic, it is possible to use the Finish Build trigger to trigger buildB on all builds of buildA.
In buildB, create a build step to check the status of the previous build of buildA and cancel itself if it was successful.
This can be achieved using the REST API:
- The status of the last build of any build configuration can be retrieved from the following endpoint:
GET /app/rest/builds?locator=buildType:<target build configuration ID>,count:1
- A running build can be canceled as described here: Cancel Started Build.
Comments
0 comments
Please sign in to leave a comment.