feat: add server-side update.sh script for in-place deploys
This commit is contained in:
parent
a3c9e5b739
commit
d4e1e4bf60
1 changed files with 25 additions and 0 deletions
25
infra/deploy/update.sh
Executable file
25
infra/deploy/update.sh
Executable file
|
|
@ -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"
|
||||
Loading…
Add table
Reference in a new issue