Roka545
Roka545

Reputation: 3636

Bamboo - return custom messages and error codes.

From the looks of it, Bamboo only returns a 0 or 1 if a script fails or succeeds. Is it possible to add any customization at all in order to get more information on why a script failed?

I have a script that builds several repositories and would like very detailed information on any failures that may occur (which repo failed, why, etc.).

Is there any way to handle this through Bamboo? I can create a log file that outputs the data I want, but if possible I would like to see any issues through Bamboo OR the Bamboo email that can be sent whenever a failure occurs. Is there a way to customize the email to include text from a text file (my log file)?

Upvotes: 2

Views: 2418

Answers (1)

Jeyanthan I
Jeyanthan I

Reputation: 1619

Bamboo expects exit 0 for a successful execution. Anything else results in a failure. However, this exit code is listed in the respective build log like below.

simple 14-Aug-2017 14:59:29 Failing task since return code of [mvn clean package] was 1 while expected 0

If you want the log snip to be sent in the email, you can just customise the Email notification template in WEB-INF/classes/notification-templates/. Some content in notifications can be configured via system properties, such as the number of log lines to include in email notifications that display log information.

Hope that helps.

Upvotes: 2

Related Questions