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

ACR Integration: Publish-PSResource methods #1501

Merged
merged 18 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading