diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 6eccbe1..4d5150c 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -139,11 +139,14 @@ docker compose version >/dev/null 2>&1 || { err "docker compose v2 required"; ex VHOST=/etc/apache2/sites-enabled/optical-dev.oliver.solutions.conf if [[ -r "$VHOST" ]]; then # 1. Slug collision: is another app already claiming /utilisation-dept/? - # Look at the live vhost AND every sibling app's apache-*.conf. + # Look at the live vhost AND every sibling app's apache-*.conf, + # filtering out our OWN conf (matched on REPO_ROOT, not SLUG, since + # the on-disk path may not match the URL slug — e.g. cloned to + # /opt/loreal-utilisation-dept/ with slug "utilisation-dept"). sibling_confs=(/opt/*/deploy/apache-*.conf) collision=$(grep -lE "(ProxyPass|Alias)[[:space:]]+${URL_PATH}/" \ "$VHOST" "${sibling_confs[@]}" 2>/dev/null \ - | grep -v "/opt/${SLUG}/" || true) + | grep -vF "${REPO_ROOT}/" || true) if [[ -n "$collision" ]]; then err "Another app claims ${URL_PATH}/ in:" echo "$collision" | sed 's/^/ /' >&2