Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .PHONY: vars env
- .SILENT: vars swarm
- COMPOSE := docker-compose -f local.yml
- # Variables
- PIP := ./env/bin/pip
- PYTHON := ./env/bin/python
- # make target FOO=bar
- APP=
- help:
- @echo
- @echo ----------------------------------------------------------------------
- @echo " Development commands file "
- @echo ----------------------------------------------------------------------
- @echo
- @echo " - docker Run docker as daemon for set IDEs like PyCharm"
- @echo " - build Build the containers for development"
- @echo " - server Server up"
- @echo " - superuser Create a superuser in development"
- @echo " - migrationn APP={app} Create migrations from project"
- @echo " - migrate Apply migrations from project"
- @echo " - flushdb Flush Database"
- @echo " - backupdb Backing Up DB"
- @echo " - backups List backups"
- @echo
- @echo ----------------------------------------------------------------------
- docker:
- @echo "Running docker socket..."
- socat -d -d TCP-L:8099,fork UNIX:/var/run/docker.sock &
- build:
- $(COMPOSE) build
- @echo "Building..."
- server:
- @echo "Server up..."
- $(COMPOSE) up
- django:
- @echo "Server for debbugging..."
- $(COMPOSE) run --service-ports django
- superuser:
- @echo "Creating superuser..."
- $(COMPOSE) run django python manage.py createsuperuser
- migrate:
- @echo "Applying migrations ..."
- $(COMPOSE) run django python manage.py migrate
- migrations:
- @echo "Creating migrations ..."
- $(COMPOSE) run django python manage.py makemigrations $(APP)
- settings:
- $(COMPOSE) run django python manage.py diffsettings
- flushdb:
- @echo "Flushing database ..."
- $(COMPOSE) run django python manage.py flush
Advertisement
Add Comment
Please, Sign In to add comment