Can I set a default argument for bash execution in Bamboo?

Chris Warren February 4, 2015

In Bamboo, I want my Bash commands and scripts to run with the -e option by default. I tried specifying "/bin/bash -e" as a custom executable, but that couldn't be detected as a capability on any of my remote agents. Is there a way to make -e a default argument/option when using Bash? There are a lot of build and deployment plans here, and going through to each one and manually adding "set -e" is something I would really like to avoid.

Thanks.

2 answers

0 votes
Chris Warren February 5, 2015

Thanks! I really like that second suggestion, and I'm a little embarrassed I wasn't able to think of it. smile

0 votes
Daniel Wester
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 4, 2015

Couple of ways:

You could set:

 

set -o pipefail

in the startup script of the bamboo agent (that would affect all builds though - kinda sledge hammer approach).

The other way would be to create a bash-e.sh script and have it execute bash -e. Then just change the executable to point to it in bamboo's ui. I would probably go for that one.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events