0
I’m developing a Django app on Docker and not have to keep typing docker-compose exec djangoapp python manage.py <alguma coisa>
i wrote a Makefile to run the commands I most use. I just don’t know how to make the Makefile take the parameters I pass to it.
For example: I can run migrate like this make migrate
with my Makefile but I can’t create a new app like this make startapp novoapp
. My question is how do I make the Makefile get the parameters I pass to it?
My Makefile is:
COMPOSE=docker-compose
DJANGOAPP=$(COMPOSE) exec djangoapp python manage.py
build:
$(COMPOSE) build
up:
$(COMPOSE) up
start:
$(COMPOSE) up -d
down:
$(COMPOSE) down
restart: down start
migrate:
$(DJANGOAPP) migrate
makemigrations:
$(DJANGOAPP) migrations
startapp:
$(DJANGOAPP) startapp
startproject:
$(DJANGOAPP) startproject
alias... Good! I didn’t even think about it, I went straight to Makefile. Thanks for the tip!
– Danilo Marto de Carvalho