Haven't checked yet
This commit is contained in:
@@ -7,15 +7,23 @@ EXPOSE 8081
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
|
||||
COPY ["FictionArchive.API/FictionArchive.API.csproj", "FictionArchive.API/"]
|
||||
COPY ["FictionArchive.Common/FictionArchive.Common.csproj", "FictionArchive.Common/"]
|
||||
COPY ["FictionArchive.Service.Shared/FictionArchive.Service.Shared.csproj", "FictionArchive.Service.Shared/"]
|
||||
RUN dotnet restore "FictionArchive.API/FictionArchive.API.csproj"
|
||||
COPY . .
|
||||
|
||||
COPY FictionArchive.API/ FictionArchive.API/
|
||||
COPY FictionArchive.Common/ FictionArchive.Common/
|
||||
COPY FictionArchive.Service.Shared/ FictionArchive.Service.Shared/
|
||||
|
||||
WORKDIR "/src/FictionArchive.API"
|
||||
RUN dotnet build "./FictionArchive.API.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
# Skip fusion build - gateway.fgp should be pre-composed in CI
|
||||
RUN dotnet build "./FictionArchive.API.csproj" -c $BUILD_CONFIGURATION -o /app/build -p:SkipFusionBuild=true
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./FictionArchive.API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
RUN dotnet publish "./FictionArchive.API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false /p:SkipFusionBuild=true
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2"/>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Builds the Fusion graph file before building the application itself -->
|
||||
<Target Name="RunFusionBuild" BeforeTargets="BeforeBuild">
|
||||
<Exec Command="python build_gateway.py" WorkingDirectory="$(ProjectDir)" />
|
||||
<!-- Builds the Fusion graph file before building the application itself (skipped in CI) -->
|
||||
<Target Name="RunFusionBuild" BeforeTargets="BeforeBuild" Condition="'$(SkipFusionBuild)' != 'true'">
|
||||
<Exec Command="python build_gateway.py $(FusionBuildArgs)" WorkingDirectory="$(ProjectDir)" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Local development script for building the Fusion gateway.
|
||||
|
||||
This script is used for local development only. In CI/CD, subgraphs are built
|
||||
separately and the gateway is composed from pre-built .fsp artifacts.
|
||||
|
||||
Usage:
|
||||
python build_gateway.py
|
||||
|
||||
Requirements:
|
||||
- .NET 8.0 SDK
|
||||
- HotChocolate Fusion CLI (dotnet tool install -g HotChocolate.Fusion.CommandLine)
|
||||
"""
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# ----------------------------------------
|
||||
# Helpers
|
||||
# ----------------------------------------
|
||||
|
||||
def run(cmd, cwd=None):
|
||||
"""Run a command and exit on failure."""
|
||||
@@ -19,7 +29,7 @@ def run(cmd, cwd=None):
|
||||
|
||||
def load_skip_list(skip_file: Path):
|
||||
if not skip_file.exists():
|
||||
print(f"WARNING: skip-projects.txt not found at {skip_file}")
|
||||
print(f"WARNING: gateway_skip.txt not found at {skip_file}")
|
||||
return set()
|
||||
|
||||
lines = skip_file.read_text().splitlines()
|
||||
@@ -53,7 +63,7 @@ print("----------------------------------------")
|
||||
|
||||
service_dirs = [
|
||||
d for d in services_dir.glob("FictionArchive.Service.*")
|
||||
if d.is_dir()
|
||||
if d.is_dir() and (d / "subgraph-config.json").exists()
|
||||
]
|
||||
|
||||
selected_services = []
|
||||
|
||||
Reference in New Issue
Block a user