Is it possible to set specific environement values as property of a command line builder?

We have a limited amount of build servers and we are building software for multiple releases of Matlab. Unfortunately Matlab Compiler requires a version of the runtime library that matches the Matlab release to compile against.

I have added all Matlab releases runtime libraries to the path and let Matlab do a best guess on for the runtime to compile against. AFAICT this works properly at the moment. However to have more control it would be nice to not have a general PATH set on the build machine (or the build job), but it would be nice if we could attach some environmental variables to the builder itself. I would also like this to differentiate between 32/64 bit libraries.

This way I can specify different PATH settings for different versions of Matlab Compiler, which will make sure that only the matching runtime libraries are in the PATH

tl;dr: So, is it possible to attach environment variables to the (command line) builder so jobs/taks inherit it?

1 answer

You can use Setx to set environment variables in a earlier task; however, this will actually change the environment variable and may cause a race condition depending on how your plans and/or branches are setup. 


You can write a script (.bat or .ps1 for example) and use Set which will only have a scope of the process that is running the script. For Bamboo it will essentially be the scope of that script so you can embed you commands after the Set command and they will use that. Batch and Powershell scripts can be passed arguments so you can still get some dynamic features/variables from Bamboo into your script. 

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,073 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