Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHubSync update #109

Merged
merged 1 commit into from Sep 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 20 additions & 19 deletions deployment/cake/generic-variables.cake
Expand Up @@ -70,25 +70,24 @@ public class VersionContext : BuildContextBase
{
CakeContext.Information("No local .git directory found, treating as dynamic repository");

//// TEMP CODE - START
//
//CakeContext.Warning("Since dynamic repositories do not yet work correctly, we clear out the cloned temp directory (which is slow, but should be fixed in 5.0 beta)");
//
//// Make a *BIG* assumption that the solution name == repository name
//var repositoryName = generalContext.Solution.Name;
//var tempDirectory = $"{System.IO.Path.GetTempPath()}\\{repositoryName}";
//
//if (CakeContext.DirectoryExists(tempDirectory))
//{
// CakeContext.DeleteDirectory(tempDirectory, new DeleteDirectorySettings
// {
// Force = true,
// Recursive = true
// });
//}
//
//// TEMP CODE - END

if (ClearCache)
{
CakeContext.Warning("Cleaning the cloned temp directory, disable by setting 'GitVersion_ClearCache' to 'false'");

// Make a *BIG* assumption that the solution name == repository name
var repositoryName = generalContext.Solution.Name;
var tempDirectory = $"{System.IO.Path.GetTempPath()}\\{repositoryName}";

if (CakeContext.DirectoryExists(tempDirectory))
{
CakeContext.DeleteDirectory(tempDirectory, new DeleteDirectorySettings
{
Force = true,
Recursive = true
});
}
}

// Dynamic repository
gitVersionSettings.UserName = generalContext.Repository.Username;
gitVersionSettings.Password = generalContext.Repository.Password;
Expand All @@ -105,6 +104,7 @@ public class VersionContext : BuildContextBase
return _gitVersionContext;
}

public bool ClearCache { get; set; }
public string MajorMinorPatch { get; set; }
public string FullSemVer { get; set; }
public string NuGet { get; set; }
Expand Down Expand Up @@ -313,6 +313,7 @@ private GeneralContext InitializeGeneralContext(BuildContext buildContext, IBuil

data.Version = new VersionContext(data)
{
ClearCache = buildContext.BuildServer.GetVariableAsBool("GitVersion_ClearCache", false, showValue: true),
MajorMinorPatch = buildContext.BuildServer.GetVariable("GitVersion_MajorMinorPatch", "unknown", showValue: true),
FullSemVer = buildContext.BuildServer.GetVariable("GitVersion_FullSemVer", "unknown", showValue: true),
NuGet = buildContext.BuildServer.GetVariable("GitVersion_NuGetVersion", "unknown", showValue: true),
Expand Down