Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change sorting of commands #354

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 58 additions & 58 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,57 @@
install: .env
.env:
test ! -f .env && cp .env.example .env

build-production:
poetry install --extras psycopg2-binary
$(MAKE) collectstatic

build:
poetry install --extras psycopg2-binary
poetry run python manage.py migrate

check: lint test requirements.txt

collectstatic:
poetry run python manage.py collectstatic --no-input

compose-build: .env
docker compose build

compose-clear:
docker compose down -v || true

compose-down:
docker compose down || true

compose-setup: compose-build
docker compose run --rm django make setup

.env:
test ! -f .env && cp .env.example .env
compose-start:
docker compose up --abort-on-container-exit

migrate:
poetry run python manage.py migrate
compose-stop:
docker compose stop || true

build:
poetry install --extras psycopg2-binary
poetry run python manage.py migrate
compose-sync:
docker compose run --rm django make sync ARGS="$(ARGS)"

start-deploy:
gunicorn config.wsgi
deploy:
git push heroku

build-production:
install: .env
poetry install --extras psycopg2-binary
$(MAKE) collectstatic

start-production:
gunicorn -b 0.0.0.0:8000 config.wsgi:application
lint:
poetry run flake8

migrate:
poetry run python manage.py migrate

requirements.txt: poetry.lock
poetry export --format requirements.txt --output requirements.txt --extras psycopg2 --without-hashes

secretkey:
poetry run python -c 'from django.utils.crypto import get_random_string; print(get_random_string(40))'

setup: migrate
echo Create a super user
Expand All @@ -34,60 +60,34 @@ setup: migrate
shell:
poetry run python manage.py shell_plus --plain

# Need to have GNU gettext installed
transprepare:
poetry run django-admin makemessages --locale ru --add-location file
poetry run django-admin makemessages --locale ru --add-location file --domain djangojs
start-deploy:
gunicorn config.wsgi

transcompile:
poetry run django-admin compilemessages
start-production:
gunicorn -b 0.0.0.0:8000 config.wsgi:application

collectstatic:
poetry run python manage.py collectstatic --no-input
start:
poetry run python manage.py runserver 0.0.0.0:8000

lint:
poetry run flake8
sync:
poetry run python manage.py fetchdata $(ARGS)

test:
poetry run coverage run --source='.' manage.py test
test-coverage-report-xml:
poetry run coverage xml

test-coverage-report: test
poetry run coverage report -m $(ARGS)
poetry run coverage erase

test-coverage-report-xml:
poetry run coverage xml

check: lint test requirements.txt

start:
poetry run python manage.py runserver 0.0.0.0:8000

compose-start:
docker compose up --abort-on-container-exit

compose-stop:
docker compose stop || true

compose-down:
docker compose down || true

compose-clear:
docker compose down -v || true

compose-sync:
docker compose run --rm django make sync ARGS="$(ARGS)"

sync:
poetry run python manage.py fetchdata $(ARGS)

secretkey:
poetry run python -c 'from django.utils.crypto import get_random_string; print(get_random_string(40))'
test:
poetry run coverage run --source='.' manage.py test

requirements.txt: poetry.lock
poetry export --format requirements.txt --output requirements.txt --extras psycopg2 --without-hashes
transcompile:
poetry run django-admin compilemessages

deploy:
git push heroku
# Need to have GNU gettext installed
transprepare:
poetry run django-admin makemessages --locale ru --add-location file
poetry run django-admin makemessages --locale ru --add-location file --domain djangojs

.PHONY: install setup shell lint test check start sync secretkey
Loading