Skip to content

Commit 1c001b8

Browse files
Add argument to dockerfile
1 parent 6134431 commit 1c001b8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/PR-Build-And-Test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
run: dotnet build --configuration Release --no-restore /p:AccessToNugetFeed=false
3636

3737
- name: Run .NET Tests
38-
run: dotnet test --no-build --configuration Release /p:AccessToNugetFeed=false
38+
run: dotnet test --no-build --configuration Release
3939

4040
- name: Set up Docker Buildx
4141
uses: docker/setup-buildx-action@v3
@@ -48,3 +48,4 @@ jobs:
4848
outputs: type=docker,dest=${{ github.workspace }}/essentialcsharpwebimage.tar
4949
cache-from: type=gha
5050
cache-to: type=gha,mode=max
51+
build-args: ACCESS_TO_NUGET_FEED=false

EssentialCSharp.Web/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#syntax=docker/dockerfile:1.2
2+
ARG ACCESS_TO_NUGET_FEED=true
23

34
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
45
WORKDIR /app
@@ -12,8 +13,8 @@ COPY . .
1213
RUN --mount=type=secret,id=nuget_auth_token \
1314
auth_token=$(cat /run/secrets/nuget_auth_token) && \
1415
export VSS_NUGET_EXTERNAL_FEED_ENDPOINTS="{\"endpointCredentials\": [{\"endpoint\":\"https://pkgs.dev.azure.com/intelliTect/_packaging/EssentialCSharp/nuget/v3/index.json\", \"password\":\"$auth_token\"}]}" && \
15-
dotnet restore "EssentialCSharp.Web.sln" && \
16-
dotnet build "EssentialCSharp.Web.sln" -c Release --no-restore && \
16+
dotnet restore "EssentialCSharp.Web.sln" -p:AccessToNugetFeed=$ACCESS_TO_NUGET_FEED && \
17+
dotnet build "EssentialCSharp.Web.sln" -c Release --no-restore -p:AccessToNugetFeed=$ACCESS_TO_NUGET_FEED && \
1718
dotnet publish "EssentialCSharp.Web.sln" -c Release -p:PublishDir=/app/publish -p:UseAppHost=false --no-build
1819

1920
FROM base AS final

0 commit comments

Comments
 (0)