-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (38 loc) · 1.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.PHONY: setup run
# Main variables
DOCKER_REPO := https://hub.docker.com/
IMAGE_NAME := wsalles/django-file-transfer
IMAGE_VERSION := latest
# Customizing your output
CODE_CHANGE="\\033["
WARNING := $(shell echo ${CODE_CHANGE}'33;5m')
BOLD_WARNING := $(shell echo ${CODE_CHANGE}'33;1m')
RUNNING := $(shell echo ${CODE_CHANGE}'32;5m')
SETUP := $(shell echo ${CODE_CHANGE}'36;4m')
NC := $(shell echo ${CODE_CHANGE}'0m')
check_%:
$(eval REQ := $(shell which $* ))
@if [ "${REQ}" = "" ]; then \
echo "${WARNING}Please, consider doing: \n${BOLD_WARNING}make setup \n \
${NC}${WARNING}\nOr just do it: \n${BOLD_WARNING}pip install $*"; \
exit 1; \
fi ||:
setup:
@echo "${SETUP}"
@pip install -r requirements.txt
run: check_uwsgi
@echo "${RUNNING}"
@uwsgi --ini uwsgi.ini
dev:
@python manage.py runserver
migrate:
@python manage.py makemigrations
@python manage.py migrate
superuser:
@python manage.py createsuperuser
docker-login:
@docker login
build:
@docker build -t ${IMAGE_NAME}:${IMAGE_VERSION} .
push: docker-login build
@docker push ${IMAGE_NAME}:${IMAGE_VERSION}