- Spostata tutta la configurazione di deployment in /deployment (docker-compose, unraid-template, guide) - Aggiunte e aggiornate guide dettagliate: publishing su Gitea, installazione Unraid, struttura progetto - Migliorato target MSBuild: publish automatico su Gitea Registry da Visual Studio, log dettagliati, condizioni più robuste - Aggiornato e ampliato .gitignore per escludere build, dati e file locali - Rimossi file obsoleti dalla root (ora tutto in /deployment) - Struttura più chiara, zero script esterni, documentazione completa e workflow di deploy semplificato
95 lines
3.9 KiB
XML
95 lines
3.9 KiB
XML
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
|
|
<PropertyGroup>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<Nullable>enable</Nullable>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<BlazorDisableThrowNavigationException>true</BlazorDisableThrowNavigationException>
|
|
|
|
<!-- Docker Publishing -->
|
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
|
<DockerfileContext>.</DockerfileContext>
|
|
|
|
<!-- Auto-versioning -->
|
|
<Version>1.0.0</Version>
|
|
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
|
<FileVersion>1.0.0.0</FileVersion>
|
|
|
|
<!-- Gitea Registry -->
|
|
<ContainerRegistry>gitea.encke-hake.ts.net</ContainerRegistry>
|
|
<ContainerRepository>alby96/encelado/tradingbot</ContainerRepository>
|
|
</PropertyGroup>
|
|
|
|
<!-- Folders for organization -->
|
|
<ItemGroup>
|
|
<Folder Include="Properties\PublishProfiles\" />
|
|
<Folder Include="docs\deployment\" />
|
|
</ItemGroup>
|
|
|
|
<!--
|
|
Post-Publish Target: Push to Gitea Container Registry
|
|
|
|
IMPORTANTE: Questo target si attiva DOPO il Docker build di Visual Studio.
|
|
Il messaggio di errore "ContainerBuild target not found" è un falso positivo
|
|
e può essere ignorato - il push su Gitea funziona correttamente.
|
|
|
|
Condizioni di attivazione:
|
|
1. Configuration = Release
|
|
2. Non siamo dentro un container Docker
|
|
3. Profilo Docker in uso (DockerPublish = 'true')
|
|
-->
|
|
<Target Name="PushToGiteaRegistry"
|
|
AfterTargets="Publish"
|
|
Condition="'$(Configuration)' == 'Release' And '$(DOTNET_RUNNING_IN_CONTAINER)' != 'true' And '$(DockerPublish)' == 'true'">
|
|
|
|
<PropertyGroup>
|
|
<GiteaImage>$(ContainerRegistry)/$(ContainerRepository)</GiteaImage>
|
|
</PropertyGroup>
|
|
|
|
<Message Importance="high" Text="" />
|
|
<Message Importance="high" Text="========================================" />
|
|
<Message Importance="high" Text="📤 Gitea Container Registry Push" />
|
|
<Message Importance="high" Text="========================================" />
|
|
<Message Importance="high" Text="" />
|
|
<Message Importance="high" Text="🏷️ Tagging images..." />
|
|
|
|
<!-- Tag with 'latest' -->
|
|
<Exec Command="docker tag tradingbot:latest $(GiteaImage):latest"
|
|
ContinueOnError="false" />
|
|
|
|
<!-- Tag with version -->
|
|
<Exec Command="docker tag tradingbot:latest $(GiteaImage):$(Version)"
|
|
ContinueOnError="false" />
|
|
|
|
<Message Importance="high" Text="✅ Tagged successfully" />
|
|
<Message Importance="high" Text="" />
|
|
<Message Importance="high" Text="📤 Pushing to $(ContainerRegistry)..." />
|
|
|
|
<!-- Push 'latest' -->
|
|
<Exec Command="docker push $(GiteaImage):latest"
|
|
ContinueOnError="false" />
|
|
|
|
<!-- Push versioned -->
|
|
<Exec Command="docker push $(GiteaImage):$(Version)"
|
|
ContinueOnError="false" />
|
|
|
|
<Message Importance="high" Text="" />
|
|
<Message Importance="high" Text="========================================" />
|
|
<Message Importance="high" Text="✅ Successfully pushed to Gitea Registry!" />
|
|
<Message Importance="high" Text="========================================" />
|
|
<Message Importance="high" Text="" />
|
|
<Message Importance="high" Text="📦 Published images:" />
|
|
<Message Importance="high" Text=" - $(GiteaImage):latest" />
|
|
<Message Importance="high" Text=" - $(GiteaImage):$(Version)" />
|
|
<Message Importance="high" Text="" />
|
|
<Message Importance="high" Text="🌐 Verify at:" />
|
|
<Message Importance="high" Text=" https://$(ContainerRegistry)/Alby96/Encelado/-/packages" />
|
|
<Message Importance="high" Text="" />
|
|
<Message Importance="high" Text="⚠️ Note: Visual Studio may show 'ContainerBuild target not found' error." />
|
|
<Message Importance="high" Text=" This is a false positive and can be safely ignored." />
|
|
<Message Importance="high" Text=" The Docker image has been successfully pushed to Gitea Registry!" />
|
|
<Message Importance="high" Text="" />
|
|
</Target>
|
|
|
|
</Project>
|