Add Kubernetes CI/CD pipeline for kub-stage

This commit is contained in:
masoud
2025-12-05 16:25:14 +00:00
parent e4c18a4751
commit 615473cf0d
2 changed files with 7 additions and 6 deletions

View File

@@ -1,12 +1,11 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
COPY src/*.sln ./
COPY src/*.sln ./ 2>/dev/null || true
COPY src/*/*.csproj ./
RUN for file in *.csproj; do mkdir -p "${file%.*}" && mv "$file" "${file%.*}/"; done
RUN dotnet restore
RUN for file in *.csproj; do mkdir -p "${file%.*}" && mv "$file" "${file%.*}/"; done 2>/dev/null || true
RUN dotnet restore "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" || dotnet restore
COPY src/ ./
ARG PROJECT_NAME=CMSMicroservice.WebApi
RUN dotnet publish "${PROJECT_NAME}/${PROJECT_NAME}.csproj" -c Release -o /app/publish --no-restore
RUN dotnet publish "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" -c Release -o /app/publish
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app