From 7147e9930f75e314cb5672932a4d8b23ce6c0e26 Mon Sep 17 00:00:00 2001 From: masoodafar-web Date: Thu, 12 Mar 2026 00:03:49 +0330 Subject: [PATCH] fix: bypass broken Nexus, use nuget.org + local proto build - NuGet.config: nuget.org for standard packages, local nupkg for proto - Dockerfile: COPY nupkg/ before restore - CI: build proto from CMS source before Docker build --- .gitea/workflows/kub-deploy.yml | 15 +++++++++++++++ src/BackOffice/Dockerfile | 3 ++- src/BackOffice/NuGet.config | 11 +++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/kub-deploy.yml b/.gitea/workflows/kub-deploy.yml index 9e15309..b45256f 100644 --- a/.gitea/workflows/kub-deploy.yml +++ b/.gitea/workflows/kub-deploy.yml @@ -55,6 +55,21 @@ jobs: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 194.5.195.53:32082 -u admin --password-stdin echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin + - name: Build Proto Package + run: | + echo "📦 Building Proto package from CMS..." + git clone --depth 1 --branch kub-stage http://gitea-svc:3000/admin/CMS.git /tmp/cms + docker run --rm --network host \ + -v /tmp/cms:/cms \ + -v $(pwd)/src/nupkg:/out \ + 194.5.195.53:32082/dotnet/sdk:9.0 sh -c ' + cd /cms/src/CMSMicroservice.Protobuf + dotnet restore --source https://api.nuget.org/v3/index.json + dotnet build -c Release --no-restore + dotnet pack -c Release --no-build -o /out + ' + echo "✅ Proto package: $(ls src/nupkg/)" + - name: Build Docker Image run: | cd src diff --git a/src/BackOffice/Dockerfile b/src/BackOffice/Dockerfile index 5b08d14..a0c6b4b 100644 --- a/src/BackOffice/Dockerfile +++ b/src/BackOffice/Dockerfile @@ -1,8 +1,9 @@ FROM 194.5.195.53:32082/dotnet/sdk:9.0 AS build WORKDIR /src -# Copy NuGet config and project file +# Copy NuGet config, local packages, and project file COPY ["BackOffice/NuGet.config", "NuGet.config"] +COPY ["nupkg/", "nupkg/"] COPY ["BackOffice/BackOffice.csproj", "BackOffice/"] # Restore dependencies diff --git a/src/BackOffice/NuGet.config b/src/BackOffice/NuGet.config index 6402f43..474b477 100644 --- a/src/BackOffice/NuGet.config +++ b/src/BackOffice/NuGet.config @@ -2,15 +2,10 @@ + - - + + - - - - - -