From 6ab67476ecbc5cba69c03eebfe6426080e6bd7c4 Mon Sep 17 00:00:00 2001 From: mcmuzzle Date: Sat, 7 Sep 2024 16:45:56 +0200 Subject: [PATCH] test --- .gitea/workflows/merge.yaml | 8 +++++++- src/LudikZoneBlazor/LudikZoneBlazor.csproj | 4 ---- src/LudikZoneBlazor/Program.cs | 7 +++++++ src/LudikZoneBlazor/appsettings.json | 6 +++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/merge.yaml b/.gitea/workflows/merge.yaml index 29f0a3b..9ce0be7 100644 --- a/.gitea/workflows/merge.yaml +++ b/.gitea/workflows/merge.yaml @@ -26,9 +26,15 @@ jobs: program: "asciidoctor -D docs --backend=html5 -o index.html documentation/readme.adoc" - name: Print execution time run: echo "Time ${{ steps.adocbuild.outputs.time }}" - - name: Deploy docs to ghpages + - name: Upload artifact uses: actions/upload-artifact@v3 with: name: Doc path: ./docs retention-days: 5 + - name: ls + run: ls + - name: build docker images + run: docker build -t gitea.borealian.ovh/mcmuzzle/ludikzone:latest -f ./docker-prod/Dockerfile . + - name: upload image + run: echo "${{ secrets.PERSO_GITEAPASSWORD}}" | docker login gitea.borealian.ovh --username mcmuzzle --password-stdin \ No newline at end of file diff --git a/src/LudikZoneBlazor/LudikZoneBlazor.csproj b/src/LudikZoneBlazor/LudikZoneBlazor.csproj index a9e2c9c..7e31e71 100644 --- a/src/LudikZoneBlazor/LudikZoneBlazor.csproj +++ b/src/LudikZoneBlazor/LudikZoneBlazor.csproj @@ -7,10 +7,6 @@ aspnet-LudikZoneBlazor-b18f2a2e-d082-4232-8521-6cacaa2a4ba2 - - - - diff --git a/src/LudikZoneBlazor/Program.cs b/src/LudikZoneBlazor/Program.cs index fa4f86e..bb9b649 100644 --- a/src/LudikZoneBlazor/Program.cs +++ b/src/LudikZoneBlazor/Program.cs @@ -74,4 +74,11 @@ app.MapRazorComponents() // Add additional endpoints required by the Identity /Account Razor components. app.MapAdditionalIdentityEndpoints(); +// Appliquer les migrations automatiquement lors du démarrage +using (var scope = app.Services.CreateScope()) +{ + var dbContext = scope.ServiceProvider.GetRequiredService(); + dbContext.Database.Migrate(); // Applique les migrations +} + app.Run(); diff --git a/src/LudikZoneBlazor/appsettings.json b/src/LudikZoneBlazor/appsettings.json index 9daf2e9..df5993f 100644 --- a/src/LudikZoneBlazor/appsettings.json +++ b/src/LudikZoneBlazor/appsettings.json @@ -1,12 +1,12 @@ { - "ConnectionStrings": { - "DefaultConnection": "DataSource=Data\\app.db;Cache=Shared" - }, "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, + "ConnectionStrings": { + "DefaultConnection": "host=localhost;username=admin;database=ludikZone;Pooling=false;Timeout=300;CommandTimeout=300;Port=5432;" + }, "AllowedHosts": "*" } \ No newline at end of file