Skip to content

Commit

Permalink
Merge pull request #109 from WildGums/GitHubSync-20190917-072153
Browse files Browse the repository at this point in the history
GitHubSync update
  • Loading branch information
GeertvanHorrik committed Sep 17, 2019
2 parents f6fa5fd + 21d2b12 commit ffeddd3
Showing 1 changed file with 20 additions and 19 deletions.
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

0 comments on commit ffeddd3

Please sign in to comment.