Fail a Build from the API

matt_mckinstry's Avatar

matt_mckinstry

17 Apr, 2018 08:19 AM

At present you can cancel a build from the API. It would be great if the API supported the ability to Fail a build.

Project MAIN. We have 4-7 build matrix configurations -> 7 build jobs. Priority 2
Project TEST. 1 Build and Test job. Priority 1.

If build job 1 from MAIN is successful we want to kick off a build on another project e.g. Project TEST
This build job will be added to the queue and run before most of the remaining MAIN build matrix jobs.

We would like to call back into the MAIN project and fail the build if the tests fail in the TEST project

Is this possible? I can see a cancel API method, but we would prefer a FAIL.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 17 Apr, 2018 06:39 PM

    Ilya Finkelshteyn's Avatar

    We do not have such an API, but here I see what can be workaround steps:

    • Job 1 from MAIN kick off a build on project Project TEST and also sends MAIN build ID (APPVEYOR_BUILD_ID environment variable value) to Project TEST build. Sample

    • Project TEST build, if failed (on_failure stage), writes this MAIN build ID to some list in the cloud (can be simple text file on GitHub).

    • All other jobs in MAIN checks that list in the cloud if it contains APPVEYOR_BUILD_ID and if yes, throw. This can be done at init (and any other stages to throw in the middle of the build job).

    Let us know if this works for you.

  2. 2 Posted by matt_mckinstry on 08 Jun, 2018 01:59 PM

    matt_mckinstry's Avatar

    Thanks Ilya, a version of this worked for us

  3. Support Staff 3 Posted by Ilya Finkelshte... on 08 Jun, 2018 04:42 PM

    Ilya Finkelshteyn's Avatar

    Great, thanks for the update!

  4. Owen McDonnell closed this discussion on 27 Aug, 2018 08:23 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac