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
Daniel Wester Community Champion Feb 04, 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.

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 Sign up to answer
Community showcase
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

506 views 0 9
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