How to stop a build without marking it "failed"

Using TeamCity 2018.1.1. We have several build configurations building the same git repo, but not all are applicable to all branches. They run a build step at the beginning of the build to check if the build should continue for this branch. If not, I fail the build step. This works, but then we get email notifications about failed builds and our pull requests show that "some builds have failed" when in fact there is no problem. Is there a way to stop the build (i.e. not run any further build steps), but not report it as failed? Ideally I'd like some kind of "ignored" status or even just delete the build from the history entirely, but if it's marked "successful" that's also OK.

1
5 comments

Hi Evan,

 

Is there a reason for you to not use VCS Trigger rules or branch filters instead of manually checking? https://confluence.jetbrains.com/display/TCD18/Configuring+VCS+Triggers#ConfiguringVCSTriggers-BranchFilterbranchFilter

 

Setting up the branch filter on a VCS Trigger will only trigger builds in the right branches for each configuration. It may also be set by a parameter, in case you want further customization.

0

Hi,

The build cannot tell whether it should run just from the name of the branch - it needs to look at the contents of the repository, at least the presence/absence of some file there.

1
Avatar
Permanently deleted user

I also stumbled upon a need for this. We have a build configuration that auto-merges a few branches and we would like the build to stop without failing if the combination of branches merged has already been built to prevent unnecessary build time. At the moment we just emit ##teamcity[buildProblem description='Already built this combination of branches' identity='alreadybuilt'] + an errorcode, but the marking as a failed build makes some noise in the overview.

There should be a service messages for stopping the build without errors, and perhaps a new option in the "Execute step" dropdown to allow certain following buildsteps to always execute.

 

1
Avatar
Permanently deleted user

Great! :-)

0

Please sign in to leave a comment.