Skip to content

Commit 218efbe

Browse files
Conditionally removing auth token logic
1 parent 1754ef4 commit 218efbe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

EssentialCSharp.Web/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ ENV ACCESS_TO_NUGET_FEED=$ACCESS_TO_NUGET_FEED
1111
RUN sh -c "$(curl -fsSL https://aka.ms/install-artifacts-credprovider.sh)"
1212
WORKDIR /src
1313
COPY . .
14-
RUN --mount=type=secret,id=nuget_auth_token \
14+
RUN if [ "$ACCESS_TO_NUGET_FEED" = "true" ]; then \
15+
--mount=type=secret,id=nuget_auth_token \
1516
auth_token=$(cat /run/secrets/nuget_auth_token) && \
1617
export VSS_NUGET_EXTERNAL_FEED_ENDPOINTS="{\"endpointCredentials\": [{\"endpoint\":\"https://pkgs.dev.azure.com/intelliTect/_packaging/EssentialCSharp/nuget/v3/index.json\", \"password\":\"$auth_token\"}]}" && \
18+
fi; \
1719
dotnet restore "EssentialCSharp.Web.sln" -p:AccessToNugetFeed=$ACCESS_TO_NUGET_FEED && \
1820
dotnet build "EssentialCSharp.Web.sln" -c Release --no-restore -p:AccessToNugetFeed=$ACCESS_TO_NUGET_FEED && \
1921
dotnet publish "EssentialCSharp.Web.sln" -c Release -p:PublishDir=/app/publish -p:UseAppHost=false --no-build

0 commit comments

Comments
 (0)