File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
src/PostSharp.Engineering.BuildTools/Docker Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details.
2+
3+ using JetBrains . Annotations ;
4+ using System . IO ;
5+
6+ namespace PostSharp . Engineering . BuildTools . Docker ;
7+
8+ [ PublicAPI ]
9+ public sealed class AzureArtifactsCredentialProviderComponent : ContainerComponent
10+ {
11+ public override string Name => "AzureArtifactsCredentialProvider" ;
12+
13+ public override ContainerComponentKind Kind => ContainerComponentKind . AzureArtifactsCredentialProvider ;
14+
15+ public override void WriteDockerfile ( TextWriter writer )
16+ {
17+ writer . WriteLine (
18+ """
19+ RUN $credProviderUrl = 'https://github.com/microsoft/artifacts-credprovider/releases/download/v1.1.2/Microsoft.NuGet.CredentialProvider.zip'; `
20+ $credProviderZip = 'Microsoft.NuGet.CredentialProvider.zip'; `
21+ $pluginsDir = 'C:\ProgramData\NuGet\plugins\netfx\CredentialProvider.Microsoft'; `
22+ Invoke-WebRequest -Uri $credProviderUrl -OutFile $credProviderZip; `
23+ New-Item -ItemType Directory -Force -Path $pluginsDir | Out-Null; `
24+ Expand-Archive -Path $credProviderZip -DestinationPath $pluginsDir -Force; `
25+ Move-Item -Path "$pluginsDir\plugins\netfx\CredentialProvider.Microsoft\*" -Destination $pluginsDir -Force; `
26+ Remove-Item -Path "$pluginsDir\plugins" -Recurse -Force; `
27+ Remove-Item $credProviderZip
28+
29+ ENV NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED=true
30+ """ ) ;
31+ }
32+ }
Original file line number Diff line number Diff line change @@ -18,7 +18,9 @@ public enum ContainerComponentKind
1818 Python ,
1919 Gulp ,
2020 GitHubCli ,
21+ AzureArtifactsCredentialProvider ,
2122 Timestamp ,
2223 Claude ,
23- Epilogue
24+ Epilogue ,
25+
2426}
You can’t perform that action at this time.
0 commit comments