Fix deploy.sh: auto-update nginx config on deploy (STI-93)
deploy.sh was only updating Docker containers but never copying the nginx config to the host. This meant changes like the sub_filter fix for GrampsWeb's <base href> rewrite were never applied. Now diffs deploy-production/nginx.conf against /etc/nginx/sites-enabled/stiftung and reloads nginx when changed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
17
deploy.sh
17
deploy.sh
@@ -135,6 +135,23 @@ echo ""
|
||||
echo "--- Collecting static files ---"
|
||||
docker compose -f "$COMPOSE_FILE" exec -T web python manage.py collectstatic --noinput
|
||||
|
||||
echo ""
|
||||
echo "--- Updating nginx config ---"
|
||||
NGINX_CONF="$PROD_DIR/deploy-production/nginx.conf"
|
||||
NGINX_DEST="/etc/nginx/sites-enabled/stiftung"
|
||||
if [[ -f "$NGINX_CONF" ]]; then
|
||||
if ! diff -q "$NGINX_CONF" "$NGINX_DEST" &>/dev/null; then
|
||||
echo "Nginx config changed — updating and reloading"
|
||||
sudo cp "$NGINX_CONF" "$NGINX_DEST"
|
||||
sudo nginx -t && sudo systemctl reload nginx
|
||||
echo "Nginx reloaded"
|
||||
else
|
||||
echo "Nginx config unchanged — skipping"
|
||||
fi
|
||||
else
|
||||
echo "WARNUNG: $NGINX_CONF nicht gefunden — nginx nicht aktualisiert"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "--- Service status ---"
|
||||
docker compose -f "$COMPOSE_FILE" ps
|
||||
|
||||
Reference in New Issue
Block a user