From 7edaca49b9268fe059a275d782344f749965da2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Tue, 6 Aug 2024 17:19:42 +0200 Subject: [PATCH] Use Docker Compose version 2 --- .github/workflows/test.yaml | 2 +- Makefile | 2 +- ci/docker-compose-check | 2 +- custom/custom/alembic/env.py | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d7005eb7a..0f59d2b16 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -38,7 +38,7 @@ jobs: - run: cp docker-compose.override.acceptance-test.yaml docker-compose.override.yaml - name: Build - run: ./build + run: ./build --docker-compose-version-2 - run: make acceptance-init - run: c2cciutils-docker-logs diff --git a/Makefile b/Makefile index 1f587b3bc..14882c38c 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ acceptance-init: docker compose exec -T tools psql --command='CREATE EXTENSION IF NOT EXISTS postgis' docker compose exec -T tools psql --command='CREATE EXTENSION IF NOT EXISTS pg_trgm' docker compose exec -T tools psql --command='CREATE EXTENSION IF NOT EXISTS hstore' - scripts/db-restore --docker-compose-file=docker-compose.yaml --docker-compose-file=docker-compose-db.yaml \ + scripts/db-restore --docker-compose-version-2 --docker-compose-file=docker-compose.yaml --docker-compose-file=docker-compose-db.yaml \ --arg=--clean --arg=--if-exists --arg=--verbose data/prod-2-7.dump docker compose restart geoportal alembic docker compose exec -T geoportal wait-db diff --git a/ci/docker-compose-check b/ci/docker-compose-check index 0d917dc81..92939cc07 100755 --- a/ci/docker-compose-check +++ b/ci/docker-compose-check @@ -7,7 +7,7 @@ import sys def _main() -> None: services = [ s.strip() - for s in subprocess.run(["docker-compose", "ps"], check=True, stdout=subprocess.PIPE) + for s in subprocess.run(["docker", "compose", "ps"], check=True, stdout=subprocess.PIPE) .stdout.decode("utf-8") .splitlines() ] diff --git a/custom/custom/alembic/env.py b/custom/custom/alembic/env.py index 9340b4f0f..75f18d185 100644 --- a/custom/custom/alembic/env.py +++ b/custom/custom/alembic/env.py @@ -1,4 +1,5 @@ """Pyramid bootstrap environment. """ + from alembic import context from custom.models.meta import Base from pyramid.paster import get_appsettings, setup_logging