Skipping build steps gracefully

Hello!

Is there a way (via Build Script Interaction) to end a build in a build step that is not the last but still have the build recorded as successful?

(Maybe by using teamcity-info.xml ? )

Thank you.

0
3 comments

Hi Wolfgang,

You probably want to take a look at this service message: https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingBuildStatus

Please, take into account that this might hide other build problems as well, so make sure that you use it with care.

0

@Denis: Yes, I know about that message. I sets the current build status and status text.

What it does not do, however, is to stop the build. Subsequent build steps are still executed.

 

My solution for now is to let the build fail but write a teamcity-info.xml immediately before that resets the build status.

0

Hi Wolfgang,

I see, didn't realize about the immediate stop. Well, you can add a custom failure condition to the build configuration, then set it to a build log message, write that message and request the build to stop immediately, but this looks overcomplicated. Is there any reason for this to be a single build configuration and not 2 separate ones tied by a snapshot dependency? Having more details about what this build does, so that it half way through automatically "passes" and stops without continuing, might help us understanding the whole thing and be able to make some suggestions.

Another option would be to use the REST API to stop the build, although that would have a slight delay.

0

Please sign in to leave a comment.