Skip to content

Commit

Permalink
remove test gallery from bump up version (Azure#26857)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickcandy authored Dec 11, 2024
1 parent 05c7e00 commit 0e12d1a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion tools/VersionController/Models/ModuleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal static string GetLatestVersionFromPSGallery(string moduleName, ReleaseT
}

/// <summary>
/// Get version from PSGallery and TestGallery and merge into one list.
/// Get version from PSGallery and merge into one list.
/// </summary>
/// <returns>A list of version</returns>
internal static List<AzurePSVersion> GetAllVersionsFromGallery(string moduleName, string psRepository)
Expand Down
15 changes: 0 additions & 15 deletions tools/VersionController/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,36 +165,21 @@ private static void BumpVersions()
{
powershell.AddScript("Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process;");
powershell.AddScript("Register-PackageSource -Name PSGallery -Location https://www.powershellgallery.com/api/v2 -ProviderName PowerShellGet");
powershell.AddScript("Register-PackageSource -Name TestGallery -Location https://www.poshtestgallery.com/api/v2 -ProviderName PowerShellGet");
powershell.AddScript("Get-PSRepository");
var repositories = powershell.Invoke();
string psgallery = null;
string testgallery = null;
foreach (var repo in repositories)
{
if ("https://www.powershellgallery.com/api/v2".Equals(repo.Properties["SourceLocation"]?.Value))
{
psgallery = repo.Properties["Name"]?.Value?.ToString();
}
if ("https://www.poshtestgallery.com/api/v2".Equals(repo.Properties["SourceLocation"]?.Value))
{
testgallery = repo.Properties["Name"]?.Value?.ToString();
}
}
if (psgallery == null)
{
throw new Exception("Cannot calculate module version because PSGallery is not available.");
}
targetRepositories = psgallery;
if (testgallery == null)
{
Console.WriteLine("Warning: Cannot calculate module version precisely because TestGallery is not available.");
}
else
{
targetRepositories += $",{testgallery}";
}

}

var changedModules = new List<string>();
Expand Down

0 comments on commit 0e12d1a

Please sign in to comment.