diff --git a/roles/app-deploy/tasks/django.yml b/roles/app-deploy/tasks/django.yml index 684bd19..24b3248 100644 --- a/roles/app-deploy/tasks/django.yml +++ b/roles/app-deploy/tasks/django.yml @@ -65,6 +65,8 @@ group: "{{ admin_user }}" mode: "0600" +# COMPOSE_PROFILES must match the start step below: without it, profile-gated +# services (e.g. the dj-queue worker) are skipped here and keep a stale image. - name: "django[{{ _project }}] build images" ansible.builtin.command: cmd: "docker compose -f {{ _spec.compose_file }} --env-file .env build" @@ -72,6 +74,7 @@ environment: COMPOSE_PROJECT_NAME: "{{ _project }}" WEB_PORT: "{{ app_item.port }}" + COMPOSE_PROFILES: "{{ (app_item.compose_profiles | default([])) | join(',') }}" become: true become_user: "{{ admin_user }}" changed_when: true