From ed0498fe948d67e4a8df5ad0fe824eec9df37922 Mon Sep 17 00:00:00 2001 From: Friedel Wolff Date: Mon, 27 May 2024 10:00:28 +0200 Subject: [PATCH 1/2] Invoke the compose plugin with `docker compose` This is part of compose v2, and the new and preferred way of invocation, and the old (with hyphen) is not available everywhere, e.g. some Linux systems don't provide something to allow for invoking `docker-compose`with hyphen. https://docs.docker.com/compose/migrate/#what-are-the-differences-between-compose-v1-and-compose-v2 --- Makefile | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index e33c4153..f5860ca3 100644 --- a/Makefile +++ b/Makefile @@ -26,51 +26,51 @@ list: up: clear - @docker-compose up + @docker compose up upd: clear - @docker-compose up -d + @docker compose up -d build: clear - @docker-compose build + @docker compose build stop: clear - @docker-compose stop + @docker compose stop down: clear - @docker-compose down + @docker compose down restart: clear - @docker-compose restart + @docker compose restart make-migrations: clear - @docker-compose run --rm web python manage.py makemigrations + @docker compose run --rm web python manage.py makemigrations migrate: clear - @docker-compose run --rm web python manage.py migrate + @docker compose run --rm web python manage.py migrate collectstatic: clear - @docker-compose run --rm web python manage.py collectstatic --noinput + @docker compose run --rm web python manage.py collectstatic --noinput shell: clear - @docker-compose run --rm web python manage.py shell + @docker compose run --rm web python manage.py shell logs: clear - @docker-compose logs -tf + @docker compose logs -tf create-super-user: clear - @docker-compose run --rm web python manage.py createsuperuser + @docker compose run --rm web python manage.py createsuperuser docker-stop-all: clear @@ -79,30 +79,30 @@ docker-stop-all: create-schema: clear - @docker-compose run --rm web python manage.py graph_models -a -o schema/schema.png + @docker compose run --rm web python manage.py graph_models -a -o schema/schema.png test: clear - @docker-compose run --rm web python manage.py test + @docker compose run --rm web python manage.py test ruff-check: clear - @docker-compose run --rm web ruff check . + @docker compose run --rm web ruff check . ruff-format: clear - @docker-compose run --rm web ruff format . + @docker compose run --rm web ruff format . ruff-fix: clear - @docker-compose run --rm web ruff check --fix . + @docker compose run --rm web ruff check --fix . load-fixtures: clear - @docker-compose run --rm web python manage.py loaddata fixtures/institution.json - @docker-compose run --rm web python manage.py loaddata fixtures/projects.json - @docker-compose run --rm web python manage.py loaddata fixtures/language.json - @docker-compose run --rm web python manage.py loaddata fixtures/subjects.json + @docker compose run --rm web python manage.py loaddata fixtures/institution.json + @docker compose run --rm web python manage.py loaddata fixtures/projects.json + @docker compose run --rm web python manage.py loaddata fixtures/language.json + @docker compose run --rm web python manage.py loaddata fixtures/subjects.json pre-commit-install: clear @@ -121,12 +121,12 @@ docker-shell: check: clear - @docker-compose run --rm web python manage.py check + @docker compose run --rm web python manage.py check make-messages: clear - @docker-compose run --rm web python manage.py makemessages --all + @docker compose run --rm web python manage.py makemessages --all compile-messages: clear - @docker-compose run --rm web python manage.py compilemessages + @docker compose run --rm web python manage.py compilemessages From ea2ebfc5494d4fbfb1f1eb0fe9c0a0e1e59ef48e Mon Sep 17 00:00:00 2001 From: Friedel Wolff Date: Mon, 27 May 2024 10:06:16 +0200 Subject: [PATCH 2/2] Remove invocation of `clear` in every make target This now follows the Unix conventions of not interfering with existing content on the screen if not needed or requested. --- Makefile | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/Makefile b/Makefile index f5860ca3..dadae41d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ list: - clear @echo "Available commands:" @echo "up - Start the project" @echo "upd - Start the project in background" @@ -25,108 +24,83 @@ list: @echo "compile-messages - Run command to ensure translation .mo files are created" up: - clear @docker compose up upd: - clear @docker compose up -d build: - clear @docker compose build stop: - clear @docker compose stop down: - clear @docker compose down restart: - clear @docker compose restart make-migrations: - clear @docker compose run --rm web python manage.py makemigrations migrate: - clear @docker compose run --rm web python manage.py migrate collectstatic: - clear @docker compose run --rm web python manage.py collectstatic --noinput shell: - clear @docker compose run --rm web python manage.py shell logs: - clear @docker compose logs -tf create-super-user: - clear @docker compose run --rm web python manage.py createsuperuser docker-stop-all: - clear docker stop `docker ps -q` docker ps create-schema: - clear @docker compose run --rm web python manage.py graph_models -a -o schema/schema.png test: - clear @docker compose run --rm web python manage.py test ruff-check: - clear @docker compose run --rm web ruff check . ruff-format: - clear @docker compose run --rm web ruff format . ruff-fix: - clear @docker compose run --rm web ruff check --fix . load-fixtures: - clear @docker compose run --rm web python manage.py loaddata fixtures/institution.json @docker compose run --rm web python manage.py loaddata fixtures/projects.json @docker compose run --rm web python manage.py loaddata fixtures/language.json @docker compose run --rm web python manage.py loaddata fixtures/subjects.json pre-commit-install: - clear pre-commit install dev-quick-install: - clear @make migrate @make load-fixtures echo "Creating superuser" @make create-super-user docker-shell: - clear docker exec -it sadilar-terminology-web bash check: - clear @docker compose run --rm web python manage.py check make-messages: - clear @docker compose run --rm web python manage.py makemessages --all compile-messages: - clear @docker compose run --rm web python manage.py compilemessages