From cee51ccec2e1676b1cd0d6bbea5feadb80f922b7 Mon Sep 17 00:00:00 2001 From: SysAdmin Agent Date: Tue, 24 Mar 2026 00:25:55 +0000 Subject: [PATCH] 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 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 --- deploy.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/deploy.sh b/deploy.sh index 00262bf..c775c43 100755 --- a/deploy.sh +++ b/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