diff --git a/.github/workflows/image-tests.yml b/.github/workflows/image-tests.yml index 1239d5ab..bdb258fe 100644 --- a/.github/workflows/image-tests.yml +++ b/.github/workflows/image-tests.yml @@ -50,16 +50,16 @@ jobs: source .env # Launch the database container - docker-compose up -d db + docker compose up -d db # Hacky method of waiting for postgres to be up and running sleep 10 # Allow Django to create databases for the testing - docker-compose exec -T db psql -v ON_ERROR_STOP=1 --username postgres -c 'ALTER USER '"$DB_USERNAME"' CREATEDB;' + docker compose exec -T db psql -v ON_ERROR_STOP=1 --username postgres -c 'ALTER USER '"$DB_USERNAME"' CREATEDB;' # Run the backend tests - docker-compose run --rm --entrypoint npm backend run test:pytest + docker compose run --rm --entrypoint npm backend run test:pytest # Run the frontend tests - docker-compose run --rm --entrypoint npm backend run test:frontend + docker compose run --rm --entrypoint npm backend run test:frontend diff --git a/deploy.sh b/deploy.sh index c72704df..ab7e1031 100755 --- a/deploy.sh +++ b/deploy.sh @@ -29,4 +29,18 @@ case $DEPLOY_ENV in ;; esac -docker-compose up -d +# Find a working docker compose +declare -a COMPOSE +if docker compose >/dev/null 2>&1 ; then + # We have compose v2 + COMPOSE[0]="docker" + COMPOSE[1]="compose" +elif which docker-compose > /dev/null 2>&1 ; then + # We have compose v1 + COMPOSE[0]="docker-compose" +else + echo "Could not find 'docker compose' or 'docker-compose'" + exit 1 +fi + +exec "${COMPOSE[@]}" up -d