From f49705b70febbd6d0f95fdca61332061ac9aab5e Mon Sep 17 00:00:00 2001 From: masiton Date: Sun, 6 Jul 2025 10:30:31 +0200 Subject: [PATCH] Fixed a bug and added redeploy step. --- .gitea/workflows/docker-build-and-push.yml | 8 +++++++- .../Parsers/PersistenceTypeParser.cs | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build-and-push.yml b/.gitea/workflows/docker-build-and-push.yml index 66f00f1..bd70162 100644 --- a/.gitea/workflows/docker-build-and-push.yml +++ b/.gitea/workflows/docker-build-and-push.yml @@ -20,4 +20,10 @@ jobs: run: | IMAGE=gitea.masita.net/mc/messengerapi:latest docker build -t $IMAGE . - docker push $IMAGE \ No newline at end of file + docker push $IMAGE + + - name: Redeploy Portainer Stack + run: | + curl -X POST "${{ secrets.PORTAINER_URL }}/api/stacks/${{ secrets. PORTAINER_STACK_ID_MESSENGER_API_DEVELOP }}/redeploy" \ + -H "Authorization: Bearer ${{ secrets.PORTAINER_TOKEN }}" \ + -H "Content-Type: application/json" \ No newline at end of file diff --git a/code/MessengerApi.Configuration/Parsers/PersistenceTypeParser.cs b/code/MessengerApi.Configuration/Parsers/PersistenceTypeParser.cs index 37ea3e0..0427240 100644 --- a/code/MessengerApi.Configuration/Parsers/PersistenceTypeParser.cs +++ b/code/MessengerApi.Configuration/Parsers/PersistenceTypeParser.cs @@ -6,6 +6,11 @@ namespace MessengerApi.Configuration.Parsers { public static PersistenceTypes Parse(string value) { + if (string.IsNullOrWhiteSpace(value)) + { + return PersistenceTypes.Sql; + } + return (PersistenceTypes)Enum.Parse(typeof(PersistenceTypes), value, true); } }