Skip to content

Commit

Permalink
Safer TFS service message markdown file location
Browse files Browse the repository at this point in the history
  • Loading branch information
Damovisa committed Feb 16, 2016
1 parent 6d87617 commit 29928ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/OctopusTools/Diagnostics/LogExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ public static void TfsServiceMessage(this ILog log, string serverBaseUrl, Projec
return;
if (buildEnvironment == BuildEnvironment.TeamFoundationBuild || buildEnvironment == BuildEnvironment.NoneOrUnknown)
{

var workingDirectory = Environment.GetEnvironmentVariable("SYSTEM_DEFAULTWORKINGDIRECTORY") ?? new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName;
var selflink = new Uri(new Uri(serverBaseUrl), release.Links["Web"].AsString());
var markdown = string.Format("[Release {0} created for '{1}']({2})", release.Version, project.Name, selflink);
var fileguid = Guid.NewGuid() + ".md";
System.IO.File.WriteAllText(fileguid, markdown);
log.InfoFormat("##vso[task.addattachment type=Distributedtask.Core.Summary;name=Octopus Deploy;]{0}", fileguid);
var markdownFile = System.IO.Path.Combine(workingDirectory, Guid.NewGuid() + ".md");
System.IO.File.WriteAllText(markdownFile, markdown);
log.InfoFormat("##vso[task.addattachment type=Distributedtask.Core.Summary;name=Octopus Deploy;]{0}", markdownFile);
}
}

Expand Down

0 comments on commit 29928ef

Please sign in to comment.