Skip to content

Commit 3f87b71

Browse files
Copilotmarkjbrown
andcommitted
Update Dockerfile to build and publish ALL extensions
Co-authored-by: markjbrown <800166+markjbrown@users.noreply.github.com>
1 parent 52f7593 commit 3f87b71

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ COPY ["Extensions/", "Extensions/"]
1111

1212
# Restore dependencies
1313
# Increase the timeout and number of retries for NuGet
14-
RUN dotnet nuget add source https://api.nuget.org/v3/index.json --name nuget.org
14+
RUN dotnet nuget list source | grep -q 'nuget.org' || dotnet nuget add source https://api.nuget.org/v3/index.json --name nuget.org
1515
ENV NUGET_PACKAGES=/nuget-packages
1616
ENV NUGET_HTTP_CACHE_PATH=/nuget-http-cache
1717
RUN mkdir -p /nuget-packages /nuget-http-cache
@@ -21,11 +21,8 @@ RUN dotnet restore "Core/Cosmos.DataTransfer.Core/Cosmos.DataTransfer.Core.cspro
2121
RUN dotnet build "Core/Cosmos.DataTransfer.Core/Cosmos.DataTransfer.Core.csproj" -c Release -o /app/build/Core --no-restore
2222
RUN dotnet publish "Core/Cosmos.DataTransfer.Core/Cosmos.DataTransfer.Core.csproj" -c Release -o /app/publish/Core --no-restore
2323

24-
# Build and publish all standard extensions
25-
RUN dotnet publish "Extensions/Json/Cosmos.DataTransfer.JsonExtension/Cosmos.DataTransfer.JsonExtension.csproj" -c Release -o /app/publish/Core/Extensions || echo "Skipping Json extension"
26-
RUN dotnet publish "Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/Cosmos.DataTransfer.CosmosExtension.csproj" -c Release -o /app/publish/Core/Extensions || echo "Skipping Cosmos extension"
27-
RUN dotnet publish "Extensions/Csv/Cosmos.DataTransfer.CsvExtension/Cosmos.DataTransfer.CsvExtension.csproj" -c Release -o /app/publish/Core/Extensions || echo "Skipping CSV extension"
28-
RUN dotnet publish "Extensions/SqlServer/Cosmos.DataTransfer.SqlServerExtension/Cosmos.DataTransfer.SqlServerExtension.csproj" -c Release -o /app/publish/Core/Extensions || echo "Skipping SqlServer extension"
24+
# Build and publish ALL extensions
25+
RUN find Extensions -name "*.csproj" | grep -v "UnitTests" | xargs -I {} sh -c 'dotnet publish "{}" -c Release -o /app/publish/Core/Extensions || echo "Skipping $(basename $(dirname {}))"'
2926

3027
# Runtime stage
3128
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime

0 commit comments

Comments
 (0)