CLI dotnet/versions build info files should be separated between the branches.

Adding a "BranchName" branchinfo.txt variable like we have in core-setup. This allows to update the correct path under dotnet/versions/build-info.

Also, moving UpdateVersionsRepo into FinalizeBuild.
This commit is contained in:
Eric Erhardt 2016-06-08 17:59:58 -05:00
parent 3c9f8dd99b
commit 0eb24de0a8
3 changed files with 9 additions and 11 deletions

View file

@ -6,3 +6,4 @@ MINOR_VERSION=0
PATCH_VERSION=0 PATCH_VERSION=0
RELEASE_SUFFIX=preview2 RELEASE_SUFFIX=preview2
CHANNEL=preview CHANNEL=preview
BRANCH_NAME=rel/1.0.0-preview2

View file

@ -75,9 +75,9 @@ namespace Microsoft.DotNet.Cli.Build
ReleaseSuffix = branchInfo["RELEASE_SUFFIX"], ReleaseSuffix = branchInfo["RELEASE_SUFFIX"],
CommitCount = commitCount CommitCount = commitCount
}; };
c.BuildContext["BuildVersion"] = buildVersion; c.BuildContext["BuildVersion"] = buildVersion;
c.BuildContext["BranchName"] = branchInfo["BRANCH_NAME"];
c.BuildContext["CommitHash"] = commitHash; c.BuildContext["CommitHash"] = commitHash;
c.Info($"Building Version: {buildVersion.SimpleVersion} (NuGet Packages: {buildVersion.NuGetVersion})"); c.Info($"Building Version: {buildVersion.SimpleVersion} (NuGet Packages: {buildVersion.NuGetVersion})");

View file

@ -15,8 +15,6 @@ namespace Microsoft.DotNet.Cli.Build
private static string Channel { get; set; } private static string Channel { get; set; }
private static string CliVersion { get; set; }
private static string CliNuGetVersion { get; set; } private static string CliNuGetVersion { get; set; }
private static string SharedFrameworkNugetVersion { get; set; } private static string SharedFrameworkNugetVersion { get; set; }
@ -27,7 +25,6 @@ namespace Microsoft.DotNet.Cli.Build
AzurePublisherTool = new AzurePublisher(); AzurePublisherTool = new AzurePublisher();
DebRepoPublisherTool = new DebRepoPublisher(Dirs.Packages); DebRepoPublisherTool = new DebRepoPublisher(Dirs.Packages);
CliVersion = c.BuildContext.Get<BuildVersion>("BuildVersion").SimpleVersion;
CliNuGetVersion = c.BuildContext.Get<BuildVersion>("BuildVersion").NuGetVersion; CliNuGetVersion = c.BuildContext.Get<BuildVersion>("BuildVersion").NuGetVersion;
SharedFrameworkNugetVersion = CliDependencyVersions.SharedFrameworkVersion; SharedFrameworkNugetVersion = CliDependencyVersions.SharedFrameworkVersion;
Channel = c.BuildContext.Get<string>("Channel"); Channel = c.BuildContext.Get<string>("Channel");
@ -107,6 +104,8 @@ namespace Microsoft.DotNet.Cli.Build
{ {
AzurePublisherTool.PublishStringToBlob($"{Channel}/dnvm/latest.{version}", cliVersion); AzurePublisherTool.PublishStringToBlob($"{Channel}/dnvm/latest.{version}", cliVersion);
} }
UpdateVersionsRepo(c);
} }
finally finally
{ {
@ -288,17 +287,15 @@ namespace Microsoft.DotNet.Cli.Build
return c.Success(); return c.Success();
} }
[Target(nameof(PrepareTargets.Init))] private static void UpdateVersionsRepo(BuildTargetContext c)
public static BuildTargetResult UpdateVersionsRepo(BuildTargetContext c)
{ {
string githubAuthToken = EnvVars.EnsureVariable("GITHUB_PASSWORD"); string githubAuthToken = EnvVars.EnsureVariable("GITHUB_PASSWORD");
string nupkgFilePath = EnvVars.EnsureVariable("NUPKG_FILE_PATH"); string nupkgFilePath = Dirs.Packages;
string versionsRepoPath = EnvVars.EnsureVariable("VERSIONS_REPO_PATH"); string branchName = c.BuildContext.Get<string>("BranchName");
string versionsRepoPath = $"build-info/dotnet/cli/{branchName}/Latest";
VersionRepoUpdater repoUpdater = new VersionRepoUpdater(githubAuthToken); VersionRepoUpdater repoUpdater = new VersionRepoUpdater(githubAuthToken);
repoUpdater.UpdatePublishedVersions(nupkgFilePath, versionsRepoPath).Wait(); repoUpdater.UpdatePublishedVersions(nupkgFilePath, versionsRepoPath).Wait();
return c.Success();
} }
} }
} }