You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
xmrauctions/Makefile

63 lines
1.9 KiB
Makefile

.PHONY: format help
# Help system from https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.DEFAULT_GOAL := help
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
build: ## Build the required containers
cp Docker/Dockerfile-* .
docker build -t xmrauctions -f Dockerfile-xmrauctions .
rm -f Dockerfile-*
up: ## Run dev service containers
cp Docker/docker-compose.yaml .
docker-compose up -d
rm -f docker-compose.yaml
down: ## Stop dev service containers
cp Docker/docker-compose.yaml .
docker-compose down
rm -f docker-compose.yaml
dev: ## Start development web service
./manage.py runserver
shell: ## Enter Django shell
./manage.py shell
clean:
rm -f *compose.yaml Dockerfile*
logs:
cp Docker/docker-compose.yaml .
docker-compose logs -f
rm -f docker-compose.yaml
### Deploy
deploy-up: ## Run the containers
docker-compose -f Docker/docker-compose.yaml -f Docker/docker-compose.deploy.yaml up -d
deploy-down: ## Stop the containers
docker-compose -f Docker/docker-compose.yaml -f Docker/docker-compose.deploy.yaml down
deploy-ps: ## Show the containers
docker-compose -f Docker/docker-compose.yaml -f Docker/docker-compose.deploy.yaml ps
deploy-logs: ## Show container logs
docker-compose -f Docker/docker-compose.yaml -f Docker/docker-compose.deploy.yaml logs -f
deploy-static: ## Collect static
docker run --rm --env-file=.env xmrauctions ./manage.py collectstatic --no-input
deploy-migrations: ## Run migrations
docker run --rm --env-file=.env --net=xmrauctions_default xmrauctions ./manage.py migrate
deploy-manage: ## Run management commands
docker run --rm -it --env-file=.env --net=xmrauctions_default xmrauctions ./manage.py $(CMD)
deploy-createadmin: ## Create admin user in Django backend
docker run --rm -it --env-file=.env --net=xmrauctions_default xmrauctions ./manage.py createsuperuser