-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
97 lines (69 loc) · 1.82 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
DOCKER=docker-compose --env-file .env --file docker/docker-compose.yaml
DEV_USER:=admin
CONSOLE:=bash
.PHONY: migrate
migrate:
python manage.py makemigrations
python manage.py makemigrations payments
python manage.py migrate
$(MAKE) migrate-stripe
.PHONY: migrate-stripe
migrate-stripe:
python manage.py djstripe_init_customers
python manage.py djstripe_sync_models
python manage.py djstripe_sync_customers
python manage.py djstripe_sync_plans_from_stripe
.PHONY: dev-createsuperuser
dev-createsuperuser:
DJANGO_SUPERUSER_PASSWORD=${DEV_USER} \
python manage.py createsuperuser \
--username ${DEV_USER} \
--email ${DEV_USER}@opensciencelabs.org \
--noinput
.PHONY: dev-migrate
dev-migrate: migrate dev-createsuperuser
.PHONY: run-tests
run-tests:
pytest
.PHONY: run-server
run-server:
python manage.py runserver
# DOCKER
.PHONY:docker-build
docker-build:
$(DOCKER) build
$(DOCKER) pull
.PHONY:docker-start
docker-start:
$(DOCKER) up -d ${SERVICES}
.PHONY:docker-stop
docker-stop:
$(DOCKER) stop ${SERVICES}
.PHONY:docker-restart
docker-restart: docker-stop docker-start
echo "[II] Docker services restarted!"
.PHONY:docker-logs
docker-logs:
$(DOCKER) logs --follow --tail 100 ${SERVICES}
.PHONY: docker-wait
docker-wait:
echo ${SERVICES} | xargs -t -n1 ./docker/healthcheck.sh
.PHONY: docker-exec
docker-exec:
$(DOCKER) exec -T ${SERVICE} ${CMD}
.PHONY: docker-console
docker-console:
$(DOCKER) exec ${SERVICE} ${CONSOLE}
.PHONY:docker-dev-prepare-db
docker-dev-prepare-db:
# used for development
$(DOCKER) exec -T poc-django-stripe bash /opt/poc-django-stripe/docker/prepare-db.sh
.PHONY:docker-bash
docker-bash:
$(DOCKER) exec ${SERVICE} bash
.PHONY:docker-run-bash
docker-run-bash:
$(DOCKER) run --rm ${SERVICE} bash
.PHONY:docker-run-stripe-cli
docker-run-stripe-cli:
$(DOCKER) run --rm stripe-cli