From a55345a80e114bcb7d705b4e6239ace77abeefed Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Mon, 6 Oct 2014 14:51:37 +0100 Subject: [PATCH] Add Environment Variable for each GV Variable In a recent Pull Request (#262), the decision was taken to, in the absence of setParameter being available in AppVeyor, to create environment variables that could then be accessible in the remainder of Build Script. I would like to suggest that this also makes sense for TeamCity. In my scenario, I want to use: ```/output buildserver``` but use the generated variables later in my psake build script. In order to do this, I have to call GitVersion twice. Using this approach should mean that I can access the created Environment Variables later in my psake script when I need them. Does that make sense? --- GitVersionCore/BuildServers/TeamCity.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GitVersionCore/BuildServers/TeamCity.cs b/GitVersionCore/BuildServers/TeamCity.cs index 957295615a..a901424fd7 100644 --- a/GitVersionCore/BuildServers/TeamCity.cs +++ b/GitVersionCore/BuildServers/TeamCity.cs @@ -28,6 +28,8 @@ public override void PerformPreProcessingSteps(string gitDirectory) public override string[] GenerateSetParameterMessage(string name, string value) { + Environment.SetEnvironmentVariable("GitVersion." + name, value); + return new[] { string.Format("##teamcity[setParameter name='GitVersion.{0}' value='{1}']", name, EscapeValue(value)),