this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(deploy): add .env backup and health check before prune

- Backup .env to timestamped file before git pull
- Wait for services to be healthy after docker compose up
- Only prune images if no services are unhealthy/exited
- Use separate build and up commands for better control

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

alice 37126a54 b91498c0

+22 -2
+22 -2
deploy.sh
··· 2 2 set -e 3 3 4 4 cd /opt/assistant 5 + 6 + # Backup .env before git pull might overwrite it 7 + if [[ -f .env ]]; then 8 + cp .env ".env.backup.$(date +%s)" 9 + fi 10 + 5 11 git pull origin main 6 - docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build 7 - docker image prune -f 12 + 13 + # Build images in parallel, then start 14 + export DOCKER_BUILDKIT=1 15 + export COMPOSE_DOCKER_CLI_BUILD=1 16 + docker compose -f docker-compose.yml -f docker-compose.prod.yml build --parallel 17 + docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d 18 + 19 + # Wait for services to be healthy before pruning 20 + echo "Waiting for services to be healthy..." 21 + sleep 10 22 + if docker compose -f docker-compose.yml -f docker-compose.prod.yml ps | grep -q "unhealthy\|Exit"; then 23 + echo "Warning: Some services may not be healthy" 24 + docker compose -f docker-compose.yml -f docker-compose.prod.yml ps 25 + else 26 + docker image prune -f 27 + fi