Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Align project structure with Lesstime: move docker/ to infra/dev/ and deploy/ to infra/prod/. Update all references in docker-compose, makefile, CI workflow, Dockerfile, .gitignore and .dockerignore. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
809 B
Bash
Executable File
29 lines
809 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
TAG="${1:-latest}"
|
|
export INVENTORY_IMAGE_TAG="$TAG"
|
|
|
|
echo "==> Deploying inventory:${TAG}..."
|
|
|
|
echo "==> Pulling image..."
|
|
sudo docker compose pull
|
|
|
|
echo "==> Starting container..."
|
|
sudo docker compose up -d
|
|
|
|
echo "==> Waiting for container to be ready..."
|
|
sleep 3
|
|
|
|
echo "==> Running migrations..."
|
|
sudo docker compose exec -T -u www-data app php bin/console doctrine:migrations:migrate --no-interaction
|
|
|
|
echo "==> Clearing cache..."
|
|
sudo docker compose exec -T -u www-data app php bin/console cache:clear --env=prod
|
|
sudo docker compose exec -T -u www-data app php bin/console cache:warmup --env=prod
|
|
|
|
VERSION=$(sudo docker compose exec -T app cat config/version.yaml | grep 'app.version' | awk -F"'" '{print $2}')
|
|
echo "==> Deployed v${VERSION}"
|