I have a script task in one of my jobs that calls a command which doesn't return a proper error code when it fails. It does, however, log a message in the logs indicating the failure. What I'd like to do is define some keywords (regular expressions) that bamboo searches for in the build logs and fails the build if any are found.
I've had a look, but can't seem to find any features like this in Bamboo. Is it possible?
If you are using Linux, maybe you could enhance your script task - redirect your output to a file, grep it, cat it and return a result.
Another option would be to create a wrapper command that will return a proper exit code.
Finally. you could write a simple Bamboo task that launches your command (it's really easy!). Tasks writing tutorial.
If you decide to write a task, look at StringMatchingInterceptor and its usages to see how to match a string against log lines.
Not out of the box. I've heard there are people with similar requirements and from what I recall they end writing up their own plugins. And in your situation (fail build when log message is encountered) I'd go the same way, by writing custom plugin.
I'd write postBuildAction plugin which would scan buildLogs for particular string after each job is completed - I'd base on http://confluence.atlassian.com/display/BAMBOO030/Tutorial+1+-+Getting+Started+with+a+Simple+Post+Build+Labeller .The "Simple Post Build Labeller" has similar functionality, it just labels the builds instead of failing them.
Not very easy solution, but doable if you have programming skills (and time).
Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs