API deployment script
This commit is contained in:
5
justfile
5
justfile
@@ -33,7 +33,10 @@ api-test:
|
|||||||
dotnet test {{api_solution}}
|
dotnet test {{api_solution}}
|
||||||
|
|
||||||
api-publish:
|
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:
|
ui-install:
|
||||||
cd {{ui_dir}} && bun install
|
cd {{ui_dir}} && bun install
|
||||||
|
|||||||
17
scripts/deploy-api.sh
Normal file
17
scripts/deploy-api.sh
Normal file
@@ -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."
|
||||||
Reference in New Issue
Block a user