Skip to content

Commit

Permalink
ACR Integration: Publish-PSResource methods (PowerShell#1501)
Browse files Browse the repository at this point in the history
  • Loading branch information
alerickson committed Apr 1, 2024
1 parent c00a1f5 commit 15ef0fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/code/ACRServerAPICalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ private static Collection<KeyValuePair<string, string>> GetDefaultHeaders(string
};
}

private bool PushNupkgACR(string outputNupkgDir, string pkgName, NuGetVersion pkgVersion, PSRepositoryInfo repository, out ErrorRecord errRecord)
internal bool PushNupkgACR(string outputNupkgDir, string pkgName, NuGetVersion pkgVersion, PSRepositoryInfo repository, out ErrorRecord errRecord)
{
errRecord = null;
// Push the nupkg to the appropriate repository
Expand Down
14 changes: 7 additions & 7 deletions src/code/PublishPSResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
using System.Management.Automation;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Xml;

Expand Down Expand Up @@ -138,6 +136,8 @@ public PSCredential ProxyCredential {
private string pathToModuleDirToPublish = string.Empty;
private ResourceType resourceType = ResourceType.None;
private NetworkCredential _networkCredential;
string userAgentString = UserAgentInfo.UserAgentString();

#endregion

#region Method overrides
Expand Down Expand Up @@ -482,16 +482,16 @@ out string[] _

string repositoryUri = repository.Uri.AbsoluteUri;

if (repository.RepositoryProvider == PSRepositoryInfo.RepositoryProviderType.ACR)
if (repository.ApiVersion == PSRepositoryInfo.APIVersion.acr)
{
// TODO: Create instance of ACR server class and call PushNupkgACR
/*
if (!PushNupkgACR(outputNupkgDir, repository, out ErrorRecord pushNupkgACRError))
ACRServerAPICalls acrServer = new ACRServerAPICalls(repository, this, _networkCredential, userAgentString);

if (!acrServer.PushNupkgACR(outputNupkgDir, _pkgName, _pkgVersion, repository, out ErrorRecord pushNupkgACRError))
{
WriteError(pushNupkgACRError);
// exit out of processing
return;
}
*/
}
else
{
Expand Down

0 comments on commit 15ef0fd

Please sign in to comment.