Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2015 Custom build variables not included as environment variables

I have added a custom variable to my build in TFS 2015, however, this variable does not appear in the environment variables when the build is run. I have verified this by running

Get-ChildItem Env:

in the PowerShell script. There is plenty of documentation about the predefined build variables, but the documentation for how to access custom variables is pretty disappointing. Any help would be appreciated.

like image 448
developagility Avatar asked Mar 15 '23 11:03

developagility


1 Answers

So I figured it out.

I initially named my variable OCTOPUS_API_KEY. I figured since I would only be accessing it as an environment variable I might as well use the env var naming convention.

Apparently, the names of the custom variables that you define get transformed by some internal undocumented rule described here.

So based on this, I renamed the variable to octopus.api.key and it was properly transformed to the OCTOPUS_API_KEY environment variable and included in the build.

It would seem that the transformation applied to variable names to make them env var friendly doesn't actually handle variables that are already in the right format.

like image 151
developagility Avatar answered Apr 26 '23 16:04

developagility