Add deploy.sh for git-based deployment
Usage: ./deploy.sh (all) or ./deploy.sh site (single service) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cbfb8d6091
commit
134e84177b
1 changed files with 30 additions and 0 deletions
30
deploy.sh
Executable file
30
deploy.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
# Deploy latest code from git and rebuild containers.
|
||||
# Usage: ./deploy.sh (rebuilds site, api, workers)
|
||||
# ./deploy.sh site (rebuilds only site)
|
||||
# ./deploy.sh api (rebuilds only api)
|
||||
set -euo pipefail
|
||||
cd /opt/performancewest
|
||||
|
||||
SERVICES="${@:-site api workers}"
|
||||
|
||||
echo "=== Pulling latest from git ==="
|
||||
git pull origin main
|
||||
|
||||
echo ""
|
||||
echo "=== Building: $SERVICES ==="
|
||||
docker compose build $SERVICES
|
||||
|
||||
echo ""
|
||||
echo "=== Restarting: $SERVICES ==="
|
||||
docker compose up -d $SERVICES
|
||||
|
||||
echo ""
|
||||
echo "=== Clearing nginx cache ==="
|
||||
sudo rm -rf /var/cache/nginx/* 2>/dev/null || true
|
||||
sudo nginx -s reload 2>/dev/null || true
|
||||
|
||||
echo ""
|
||||
echo "=== Done ==="
|
||||
git log --oneline -1
|
||||
docker compose ps --format "table {{.Name}}\t{{.Status}}" | head -10
|
||||
Loading…
Reference in a new issue