Compare commits

...

2 Commits

Author SHA1 Message Date
gitea-actions
4d106e9625 chore: bump version to v0.1.26
All checks were successful
Auto Tag Develop / tag (push) Successful in 6s
Build & Push Docker Image / build (push) Successful in 18s
2026-04-07 13:29:50 +00:00
Matthieu
9748862684 fix(infra) : add deploy.sh with maintenance mode like Inventory
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Maintenance is handled by nginx-proxy on the host, not inside the
container. deploy.sh extracts maintenance.html from the container.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 15:29:42 +02:00
3 changed files with 39 additions and 11 deletions

View File

@@ -1,2 +1,2 @@
parameters:
app.version: '0.1.25'
app.version: '0.1.26'

38
infra/prod/deploy.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
TAG="${1:-latest}"
export COLTURA_IMAGE_TAG="$TAG"
echo "==> Deploying coltura:${TAG}..."
echo "==> Enabling maintenance mode..."
touch maintenance.on
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 "==> Extracting maintenance page..."
mkdir -p public
sudo docker compose cp app:/var/www/html/public/maintenance.html public/maintenance.html
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
echo "==> Disabling maintenance mode..."
rm -f maintenance.on
VERSION=$(sudo docker compose exec -T app cat config/version.yaml | grep 'app.version' | awk -F"'" '{print $2}')
echo "==> Deployed v${VERSION}"

View File

@@ -10,16 +10,6 @@ server {
access_log /dev/stdout;
error_log /dev/stderr;
# Mode maintenance : créer /var/www/html/maintenance.on pour activer
if (-f /var/www/html/maintenance.on) {
return 503;
}
error_page 503 @maintenance;
location @maintenance {
root /var/www/html/public;
rewrite ^(.*)$ /maintenance.html break;
}
location ^~ /api/ {
root /var/www/html/public;
try_files $uri /index.php?$query_string;