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 Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

839 views 3 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