Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings#warninglevel -->
<WarningLevel>5</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Roslynator.Analyzers">
Expand Down
18 changes: 12 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,25 @@ COPY ./OpenttdDiscord.Validation.Tests/OpenttdDiscord.Validation.Tests.csproj ./

COPY ./OpenttdDiscord.sln .
RUN dotnet restore --disable-parallel
COPY . /build
COPY . .

FROM build AS publish
ARG CONFIGURATION=Release

RUN dotnet publish "/build/OpenttdDiscord.Discord/OpenttdDiscord.Discord.csproj" -c $CONFIGURATION -o /app/publish
RUN dotnet publish "/build/OpenttdDiscord.Database.Migrator/OpenttdDiscord.Database.Migrator.csproj" -c $CONFIGURATION -o /app/migrator
RUN dotnet publish "/OpenttdDiscord.Discord/OpenttdDiscord.Discord.csproj" -c $CONFIGURATION -o /app/publish
RUN dotnet publish "/OpenttdDiscord.Database.Migrator/OpenttdDiscord.Database.Migrator.csproj" -c $CONFIGURATION -o /app/migrator

FROM build as dbMigrations

RUN dotnet tool install --global dotnet-ef --version 10.0.2
ENV PATH="$PATH:/root/.dotnet/tools"
WORKDIR /build/OpenttdDiscord.Database
RUN dotnet ef migrations script -v -i -o /script.sql
WORKDIR /OpenttdDiscord.Database
RUN dotnet restore --disable-parallel
WORKDIR /
RUN dotnet ef migrations script \
--project OpenttdDiscord.Database/OpenttdDiscord.Database.csproj \
--startup-project OpenttdDiscord.Database/OpenttdDiscord.Database.csproj \
-v -i -o /script.sql

ARG RUN_IMG=mcr.microsoft.com/dotnet/aspnet:6.0
FROM ${BUILD_IMG} AS run
Expand All @@ -54,4 +59,5 @@ ENTRYPOINT ["bash", "-c", "./startup.sh"]






Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Database\OpenttdDiscord.Database.csproj" />
<ProjectReference Include="../OpenttdDiscord.Database/OpenttdDiscord.Database.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Database\OpenttdDiscord.Database.csproj" />
<ProjectReference Include="..\OpenttdDiscord.DockerizedTesting\OpenttdDiscord.DockerizedTesting.csproj" />
<ProjectReference Include="../OpenttdDiscord.Database/OpenttdDiscord.Database.csproj" />
<ProjectReference Include="../OpenttdDiscord.DockerizedTesting/OpenttdDiscord.DockerizedTesting.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion OpenttdDiscord.Database/OpenttdDiscord.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Domain\OpenttdDiscord.Domain.csproj" />
<ProjectReference Include="../OpenttdDiscord.Domain/OpenttdDiscord.Domain.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion OpenttdDiscord.Discord/OpenttdDiscord.Discord.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Infrastructure\OpenttdDiscord.Infrastructure.csproj" />
<ProjectReference Include="../OpenttdDiscord.Infrastructure/OpenttdDiscord.Infrastructure.csproj" />
</ItemGroup>
<ProjectExtensions>
<VisualStudio>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Domain\OpenttdDiscord.Domain.csproj" />
<ProjectReference Include="..\OpenttdDiscord.Tests.Common\OpenttdDiscord.Tests.Common.csproj" />
<ProjectReference Include="../OpenttdDiscord.Domain/OpenttdDiscord.Domain.csproj" />
<ProjectReference Include="../OpenttdDiscord.Tests.Common/OpenttdDiscord.Tests.Common.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion OpenttdDiscord.Domain/OpenttdDiscord.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Base\OpenttdDiscord.Base.csproj" />
<ProjectReference Include="../OpenttdDiscord.Base/OpenttdDiscord.Base.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Maintenance\UseCases" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Infrastructure\OpenttdDiscord.Infrastructure.csproj" />
<ProjectReference Include="..\OpenttdDiscord.Tests.Common\OpenttdDiscord.Tests.Common.csproj" />
<ProjectReference Include="../OpenttdDiscord.Infrastructure/OpenttdDiscord.Infrastructure.csproj" />
<ProjectReference Include="../OpenttdDiscord.Tests.Common/OpenttdDiscord.Tests.Common.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Database\OpenttdDiscord.Database.csproj" />
<ProjectReference Include="..\OpenttdDiscord.Validation\OpenttdDiscord.Validation.csproj" />
<ProjectReference Include="../OpenttdDiscord.Database/OpenttdDiscord.Database.csproj" />
<ProjectReference Include="../OpenttdDiscord.Validation/OpenttdDiscord.Validation.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Base\OpenttdDiscord.Base.csproj" />
<ProjectReference Include="../OpenttdDiscord.Base/OpenttdDiscord.Base.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Validation\OpenttdDiscord.Validation.csproj" />
<ProjectReference Include="../OpenttdDiscord.Validation/OpenttdDiscord.Validation.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion OpenttdDiscord.Validation/OpenttdDiscord.Validation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenttdDiscord.Domain\OpenttdDiscord.Domain.csproj" />
<ProjectReference Include="../OpenttdDiscord.Domain/OpenttdDiscord.Domain.csproj" />
</ItemGroup>
</Project>
Loading