Skip to content

Commit 16cb725

Browse files
committed
fix: handle existing NuGet source in GOV.UK Pay build stage
The .NET 6 SDK image may already have a 'github' NuGet source configured from a previous layer. Remove it first before adding.
1 parent d49b75f commit 16cb725

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • cloudformation/scenarios/localgov-ims/docker

cloudformation/scenarios/localgov-ims/docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ RUN Invoke-WebRequest -Uri 'https://github.com/LocalGovIMS/localgov-ims-integrat
7575
Remove-Item src.zip, C:\tmp -Recurse -Force
7676

7777
# Add GitHub Packages NuGet source for LocalGovIMS packages
78-
RUN dotnet nuget add source "https://nuget.pkg.github.com/LocalGovIMS/index.json" `
78+
# Use remove+add to avoid "source already exists" error on rebuild
79+
RUN dotnet nuget remove source github 2>$null ; `
80+
dotnet nuget add source "https://nuget.pkg.github.com/LocalGovIMS/index.json" `
7981
-n github -u USERNAME -p $env:GITHUB_TOKEN --store-password-in-clear-text
8082

8183
# Restore and publish

0 commit comments

Comments
 (0)