Skip to content

Commit a55345a

Browse files
committed
Add Environment Variable for each GV Variable
In a recent Pull Request (GitTools#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?
1 parent 2805e26 commit a55345a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

GitVersionCore/BuildServers/TeamCity.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public override void PerformPreProcessingSteps(string gitDirectory)
2828

2929
public override string[] GenerateSetParameterMessage(string name, string value)
3030
{
31+
Environment.SetEnvironmentVariable("GitVersion." + name, value);
32+
3133
return new[]
3234
{
3335
string.Format("##teamcity[setParameter name='GitVersion.{0}' value='{1}']", name, EscapeValue(value)),

0 commit comments

Comments
 (0)