From 613c8b1645fea92129d98e06a22f9fd62ea744ac Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Fri, 6 Feb 2026 16:32:21 +0100 Subject: [PATCH] fix: Streamline variable interpolation in deploy workflow and Traefik labels by removing unnecessary quoting and default fallbacks. --- .gitea/workflows/deploy.yml | 12 +++++------ docker-compose.yaml | 42 ++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 991226b..06511fd 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -60,27 +60,27 @@ jobs: TARGET="testing" IMAGE_TAG="testing-${SHORT_SHA}" ENV_FILE=".env.testing" - TRAEFIK_HOST="\`testing.${DOMAIN_BASE}\`" + TRAEFIK_HOST="testing.${DOMAIN_BASE}" NEXT_PUBLIC_BASE_URL="https://testing.${DOMAIN_BASE}" DIRECTUS_URL="https://cms.testing.${DOMAIN_BASE}" - DIRECTUS_HOST="\`cms.testing.${DOMAIN_BASE}\`" + DIRECTUS_HOST="cms.testing.${DOMAIN_BASE}" elif [[ "${{ github.ref_type }}" == "tag" ]]; then if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then TARGET="production" IMAGE_TAG="$TAG" ENV_FILE=".env.prod" - TRAEFIK_HOST="\`${DOMAIN_BASE}\`, \`www.${DOMAIN_BASE}\`" + TRAEFIK_HOST="${DOMAIN_BASE}, www.${DOMAIN_BASE}" NEXT_PUBLIC_BASE_URL="https://${DOMAIN_BASE}" DIRECTUS_URL="https://cms.${DOMAIN_BASE}" - DIRECTUS_HOST="\`cms.${DOMAIN_BASE}\`" + DIRECTUS_HOST="cms.${DOMAIN_BASE}" elif [[ "$TAG" =~ -rc || "$TAG" =~ -beta || "$TAG" =~ -alpha ]]; then TARGET="staging" IMAGE_TAG="$TAG" ENV_FILE=".env.staging" - TRAEFIK_HOST="\`staging.${DOMAIN_BASE}\`" + TRAEFIK_HOST="staging.${DOMAIN_BASE}" NEXT_PUBLIC_BASE_URL="https://staging.${DOMAIN_BASE}" DIRECTUS_URL="https://cms.staging.${DOMAIN_BASE}" - DIRECTUS_HOST="\`cms.staging.${DOMAIN_BASE}\`" + DIRECTUS_HOST="cms.staging.${DOMAIN_BASE}" else TARGET="skip" fi diff --git a/docker-compose.yaml b/docker-compose.yaml index 3a30c64..30c3f30 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,24 +8,24 @@ services: - ${ENV_FILE:-.env} labels: - "traefik.enable=true" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.rule=Host(`${TRAEFIK_HOST:-mb-grid-solutions.localhost}`)" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.entrypoints=websecure" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.tls.certresolver=le" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.tls=true" - - "traefik.http.services.${PROJECT_NAME:-mb-grid-solutions}.loadbalancer.server.port=3000" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}.middlewares=${PROJECT_NAME:-mb-grid-solutions}-auth" + - "traefik.http.routers.${PROJECT_NAME}.rule=Host(`${TRAEFIK_HOST:-mb-grid-solutions.localhost}`)" + - "traefik.http.routers.${PROJECT_NAME}.entrypoints=websecure" + - "traefik.http.routers.${PROJECT_NAME}.tls.certresolver=le" + - "traefik.http.routers.${PROJECT_NAME}.tls=true" + - "traefik.http.services.${PROJECT_NAME}.loadbalancer.server.port=3000" + - "traefik.http.routers.${PROJECT_NAME}.middlewares=${PROJECT_NAME}-auth" # Gatekeeper Router (Shared Host + dedicated Subdomain) - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.rule=(Host(`${TRAEFIK_HOST:-mb-grid-solutions.localhost}`) && PathPrefix(`/gatekeeper`)) || Host(`gatekeeper.${TRAEFIK_HOST:-mb-grid-solutions.localhost}`)" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.entrypoints=websecure" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.tls.certresolver=le" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.tls=true" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.service=${PROJECT_NAME:-mb-grid-solutions}-gatekeeper" + - "traefik.http.routers.${PROJECT_NAME}-gatekeeper.rule=(Host(`${TRAEFIK_HOST:-mb-grid-solutions.localhost}`) && PathPrefix(`/gatekeeper`)) || Host(`gatekeeper.${TRAEFIK_HOST:-mb-grid-solutions.localhost}`)" + - "traefik.http.routers.${PROJECT_NAME}-gatekeeper.entrypoints=websecure" + - "traefik.http.routers.${PROJECT_NAME}-gatekeeper.tls.certresolver=le" + - "traefik.http.routers.${PROJECT_NAME}-gatekeeper.tls=true" + - "traefik.http.routers.${PROJECT_NAME}-gatekeeper.service=${PROJECT_NAME}-gatekeeper" # Auth Middleware Definition - - "traefik.http.middlewares.${PROJECT_NAME:-mb-grid-solutions}-auth.forwardauth.address=http://${PROJECT_NAME:-mb-grid-solutions}-gatekeeper:3000/api/verify" - - "traefik.http.middlewares.${PROJECT_NAME:-mb-grid-solutions}-auth.forwardauth.trustForwardHeader=true" - - "traefik.http.middlewares.${PROJECT_NAME:-mb-grid-solutions}-auth.forwardauth.authResponseHeaders=X-Auth-User" + - "traefik.http.middlewares.${PROJECT_NAME}-auth.forwardauth.address=http://${PROJECT_NAME}-gatekeeper:3000/api/verify" + - "traefik.http.middlewares.${PROJECT_NAME}-auth.forwardauth.trustForwardHeader=true" + - "traefik.http.middlewares.${PROJECT_NAME}-auth.forwardauth.authResponseHeaders=X-Auth-User" gatekeeper: image: registry.infra.mintel.me/mintel/gatekeeper:latest @@ -42,7 +42,7 @@ services: PROJECT_COLOR: "#82ed20" labels: - "traefik.enable=true" - - "traefik.http.services.${PROJECT_NAME:-mb-grid-solutions}-gatekeeper.loadbalancer.server.port=3000" + - "traefik.http.services.${PROJECT_NAME}-gatekeeper.loadbalancer.server.port=3000" directus: image: directus/directus:11 @@ -70,12 +70,12 @@ services: - ./directus/extensions:/directus/extensions labels: - "traefik.enable=true" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-directus.rule=Host(`${DIRECTUS_HOST:-cms.mb-grid-solutions.localhost}`)" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-directus.entrypoints=websecure" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-directus.tls.certresolver=le" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-directus.tls=true" - - "traefik.http.routers.${PROJECT_NAME:-mb-grid-solutions}-directus.middlewares=${PROJECT_NAME:-mb-grid-solutions}-auth" - - "traefik.http.services.${PROJECT_NAME:-mb-grid-solutions}-directus.loadbalancer.server.port=8055" + - "traefik.http.routers.${PROJECT_NAME}-directus.rule=Host(`${DIRECTUS_HOST:-cms.mb-grid-solutions.localhost}`)" + - "traefik.http.routers.${PROJECT_NAME}-directus.entrypoints=websecure" + - "traefik.http.routers.${PROJECT_NAME}-directus.tls.certresolver=le" + - "traefik.http.routers.${PROJECT_NAME}-directus.tls=true" + - "traefik.http.routers.${PROJECT_NAME}-directus.middlewares=${PROJECT_NAME}-auth" + - "traefik.http.services.${PROJECT_NAME}-directus.loadbalancer.server.port=8055" directus-db: image: postgres:15-alpine