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
This commit is contained in:
masoodafar-web
2026-03-12 00:04:04 +03:30
parent c793630962
commit 4dc7b52289
3 changed files with 20 additions and 9 deletions
+15
View File
@@ -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 194.5.195.53:32082 -u admin --password-stdin
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -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 - name: Build Docker Image
run: | run: |
cd src cd src
+2 -1
View File
@@ -1,8 +1,9 @@
FROM 194.5.195.53:32082/dotnet/sdk:9.0 AS build FROM 194.5.195.53:32082/dotnet/sdk:9.0 AS build
WORKDIR /src WORKDIR /src
# Copy NuGet config and project file # Copy NuGet config, local packages, and project file
COPY ["FrontOffice.Main/NuGet.config", "NuGet.config"] COPY ["FrontOffice.Main/NuGet.config", "NuGet.config"]
COPY ["nupkg/", "nupkg/"]
COPY ["FrontOffice.Main/FrontOffice.Main.csproj", "FrontOffice.Main/"] COPY ["FrontOffice.Main/FrontOffice.Main.csproj", "FrontOffice.Main/"]
# Restore dependencies # Restore dependencies
+3 -8
View File
@@ -2,15 +2,10 @@
<configuration> <configuration>
<packageSources> <packageSources>
<clear /> <clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<!-- Local packages (dev builds) --> <!-- Local packages (dev builds) -->
<add key="Local" value="/home/masoud/Apps/project/FourSat/nupkg" /> <add key="Local" value="/home/masoud/Apps/project/FourSat/nupkg" />
<!-- Nexus (hosts FourSat packages + proxies nuget.org) --> <!-- Local packages (CI Docker builds) -->
<add key="Nexus" value="http://194.5.195.53:32081/repository/nuget-all/index.json" allowInsecureConnections="true" /> <add key="LocalCI" value="nupkg" />
</packageSources> </packageSources>
<packageSourceCredentials>
<Nexus>
<add key="Username" value="admin" />
<add key="ClearTextPassword" value="87zH26nbqT" />
</Nexus>
</packageSourceCredentials>
</configuration> </configuration>