This repository has been archived by the owner on Apr 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMakefile
92 lines (59 loc) · 3.36 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
#!/usr/bin/make -f
.PHONY: help start stop restart build destroy
.PHONY: migrate upgrade seed lint
.PHONY: test-users recreate-users upgrade-users migrate-user
.PHONY: seed-users lint-users test-events recreate-events
.PHONY: upgrade-events migrate-events lint-events
.DEFAULT_GOAL := help
PROJECT_NAME := 'my-dev-space'
DOCKER_COMPOSE_FILE := ./docker-compose-dev.yml
help:
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
start: ## Install dependencies and start all services
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) up -d
build: ## Pull and build all services
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) build --no-cache --pull
stop: ## Bring down all services
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) down
restart: ## Restart all services
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) restart
destroy: ## Remove all services, images, and their volumes
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) down -v --rmi all --remove-orphans
migrate: ## Run the latest migrations for the users and events service
migrate-users migrate-events
upgrade: ## Run all migrations for the users and events service
upgrade-users upgrade-events
seed: ### Creates the users and events database and seeds the user database
recreate-users seed-users recreate-events
lint: ## Runs linting for the users and events services
lint-users lint-events
test: ## Runs tests for the users and events services
test-events test-users
coverage:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run users-service python manage.py cov
test-users:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run users-service python manage.py test
recreate-users:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run users-service python manage.py recreate_db
upgrade-users:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run users-service python manage.py upgrade
migrate-users:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run users-service python manage.py migrate
seed-users:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run users-service python manage.py seed_db
lint-users:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run users-service pytest --black --pep8 --flakes -vv --mccabe --cov=project --cov-report=term-missing --junitxml=test-results/results.xml
test-events:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run events-service python manage.py test
recreate-events:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run events-service python manage.py recreate_db
upgrade-events:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run events-service python manage.py upgrade
migrate-events:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run events-service python manage.py migrate
lint-events:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run events-service pytest --black --pep8 --flakes -vv --mccabe --cov=project --cov-report=term-missing --junitxml=test-results/results.xml
test-client:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run users-service python manage.py seed_db
lint-client:
docker-compose -p $(PROJECT_NAME) -f $(DOCKER_COMPOSE_FILE) run users-service python manage.py seed_db