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

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

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.

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

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,066 views 0 5
Read article

Atlassian User Groups

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!

Find my local user group

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

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot