From d4e1e4bf609da06b004263e7ebeba3e392404727 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Mon, 27 Apr 2026 12:30:50 +0100 Subject: [PATCH] feat: add server-side update.sh script for in-place deploys --- infra/deploy/update.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 infra/deploy/update.sh diff --git a/infra/deploy/update.sh b/infra/deploy/update.sh new file mode 100755 index 0000000..5dbf9a1 --- /dev/null +++ b/infra/deploy/update.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Run directly on the server from /opt/ai-cost-tracker/ +# Usage: ./infra/deploy/update.sh [--no-cache] +# Updates to latest code and restarts all containers + +set -euo pipefail + +COMPOSE="docker compose -f infra/docker-compose.yml" +NO_CACHE=${1:-} + +echo "==> Pulling latest code..." +git pull origin main + +echo "==> Building containers${NO_CACHE:+ (no-cache)}..." +$COMPOSE build ${NO_CACHE:+--no-cache} + +echo "==> Restarting services..." +$COMPOSE up -d + +echo "==> Status:" +$COMPOSE ps + +echo "" +echo "Done! App: https://optical-dev.oliver.solutions/cost-tracker/" +echo "API: https://optical-dev.oliver.solutions/cost-tracker/v1/health"