Using capabilities to resolve the path to an executeable

Consider this scenario:

  • we have 1 set of scripts to build two projects
  • the first project requires a certain executable (lets say GWT 2.0)
  • the second project requires another executeable (lets say GWT 2.4)

I configured two custom capabilities on the bamboo server: GWT2.0 and GWT 2.4.

Each project has its own plan in bamboo and the relevant jobs are marked with the relevant requirement.

To pass the location of the GWT folder to each build script (Ant) I pass a system property to the build target like this:


What troubles me is that I need to alter this system property to include the correct capability's path. What I would want to do is:

  1. Add the capability to the job for the relevant GWT version (already doing that)
  2. Referencing the capability in a generic way to be able to do something like:

This would require something like a custom type level on capabilities along with the possibility to find a capability based on its type using bamboo variabled.

Is something like this possible? Are there other ways of doing this kind of abstraction?
I have several cases where I could use this patterns, its not only for the GWT compiler location (app server location for ejb compiles ...).

many thanks

3 answers

1 accepted

0 votes
Accepted answer

I dont think there is a native way to do what you are wanting... the capability part of the variable I believe is only designed to obtain the value of that particular agent's capability so it can be used. So if AgentA had GWT 2.0 in "/usr/bin" and AgentB had GWT 2.0 in "/usr/local/bin" then you could get the path for that particular build.

Yeah that's what I thought, maybe Atlassian would find this something neath to add to the product?

Thanks for your input!

According to the Bamboo documentation one is supposed to do this, but it does not appear to work. See the documentation --

And I found references to this capability back in Bamboo 2.

Following the instructions to see the value to be used I use this in a script task (Bamboo running on Linux)

echo "GIT ${bamboo.capablity.system.git.executable}"

I get errors like this

02-Jan-2014 11:01:02	/prodinfolocal/atlassian-bamboo-5.2/temp/ line 2: GIT at ${bamboo.capablity.system.git.executable}: bad substitution

Just to help anyone looking, this does in fact work.  There is a typo in the syntax listed in the response:


Also, you would need to pass this as an argument into the script for it to work correctly. 

This actually works if you

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Jan 15, 2019 in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

261 views 4 1
Join discussion

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