Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Jonathan Martens September 14, 2014

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

0 votes
Jason Monsorno
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 14, 2014

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. 

-or-

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 Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events