From c613273e7e3113d165e6f55156ce75ce8c357721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veikko=20Lintuj=C3=A4rvi?= Date: Wed, 11 Mar 2026 21:21:35 +0200 Subject: [PATCH] API deployment script --- justfile | 5 ++++- scripts/deploy-api.sh | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 scripts/deploy-api.sh diff --git a/justfile b/justfile index 4d5f8a6..42dc853 100644 --- a/justfile +++ b/justfile @@ -33,7 +33,10 @@ api-test: dotnet test {{api_solution}} api-publish: - dotnet publish {{api_project}} -c Release + dotnet publish {{api_project}} -c Release -o {{root_dir}}/api/publish + +deploy-new-version: + {{root_dir}}/scripts/deploy-api.sh ui-install: cd {{ui_dir}} && bun install diff --git a/scripts/deploy-api.sh b/scripts/deploy-api.sh new file mode 100644 index 0000000..cb6fc33 --- /dev/null +++ b/scripts/deploy-api.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" + +echo "==> Pulling latest changes..." +git -C "$REPO_DIR" pull + +echo "==> Publishing API..." +dotnet publish "$REPO_DIR/api/App/App.csproj" \ + -c Release \ + -o "$REPO_DIR/api/publish" + +echo "==> Restarting service..." +sudo systemctl restart klapi-api + +echo "==> Done."