Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bamboo Fail a Build with Specific Text

Chris G February 14, 2013

I want to fail a build when certain text shows up in the log. Is there any way to do this in Bamboo?

4 answers

1 accepted

0 votes
Answer accepted
Brent Villalobos
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 14, 2013

The logs just pipe stdout and stderr. If you want to stop and fail the build as soon as the text shows up, then you would need to develop a log checking thread/process to whatever you are running. In other words, it's not a Bamboo thing.

If you can wait until the job is finished, then you can create another job in a subsequent stage that gets the log contents via an http "GET". You can use a program like curl or write up something using the scripting language of your choice. The URL is consistent and looks something like: "http://bamboo_url/download/PROJ-PLAN-JOB/build_logs/PROG-PLAN-JOB-BUILDNUM.log". The build number and build result keys are Bamboo variables. Once you have the log text, it's a simple matter of grepping for the line and then exiting with either a 0 exit code (success) or non-zero exit code (failure).

Chris G February 14, 2013

Wow, it seems crazy to me that Bamboo doesn't have a feature like this. It's an extremely useful feature of TeamCity.

1 vote
Justin Pope July 29, 2013

@chris Agreed. In TeamCity this was super easy, unfortunate to discover this limitation...

0 votes
Rune_Engseth September 18, 2014

+1

0 votes
Pavlo Voznenko April 6, 2014

+1 this even implemented in Jenkins

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events