In TeamCity you can specify build parameters which can then be accessed by MSBuild. I currently use this feature to distinguish between deployment environment targets using a system parameter called DeployTo. I thought this would be accessible through Fake.EnvironmentHelper but when I print environVar "DeployTo" there is nothing there. I have also tried listing environVars EnvironmentVariableTarget.Machine but it is not listed there either.
I have tried passing it in as a command-line argument like so:
build.fsx Deploy --envvar DeployTo Test
or
build.fsx Deploy -ev DeployTo Test
However, instead of passing "Test", the environment variable is set to "true"
Is there any way to access a TeamCity build parameter from a FAKE build script?
In order to see parameter as environment variable, you must define it with prefix
env..If you define a parameter
env.DeployTowith valueTest, it will be accessible to the build as environmental variableDeployTo