Set variable/metadata from bash/batch script possible ?

Hi,

I know that Bamboo variables from a build plan can be accessed in bash but can i also set them ? I need to set a variable or metadata that would be saved with the build and can be retrieved with REST API afterwards if needed ? Is that possible if so how ?

/donnib

1 answer

0 vote

Only indirectly (and partially), i.e. there is no REST API for management of Bamboo variables - please watch/vote/comment on the following issues to raise awareness for this surprising limitation:

That being said, you can at least use the Script task to write the variables to a properties file, which can be injected via a subsequent Variables task afterwards:

@Steffen Opel [Utoolity] thanks but it does not solve my problem. I did find the Inject variables but when i don't have REST endpoint to get the variables then i can't solve my problem sad

@Mihai Marinescu - yeah, I understand and can feel your pain. Unfortunately I'm not in a position to do anything about this, which is why I referenced the related Atlassian issue.

Of course, depending on how important this is for your use case, you can always develop your own Bamboo add-on to implement a REST endpoint that exposes the desired variables (in case, I'd recommend to support variable namespaces and/or password masking so that you do not expose possibly sensitive information like passwords by default). 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
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,567 views 0 6
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