-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (34 loc) · 914 Bytes
/
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
#
# Definitions
#
# Docker compose which the services are defined.
COMPOSE_FILE = docker-compose.yml
# Utility
RUN_IN_CONTAINER = docker compose -f $(COMPOSE_FILE) exec $(CONTAINER_BASE) $(COMMAND)
#
# Application
#
up: ## Start application (default)
docker compose -f $(COMPOSE_FILE) up -d
down: ## Stop application
docker compose -f $(COMPOSE_FILE) down
#
# Database
#
migrations: ## Run database migrations
$(RUN_IN_CONTAINER) service flask db upgrade
#
# Example
#
ingest: ## Ingest example data
$(RUN_IN_CONTAINER) service python example/ingest/ingest.py
#
# Logs
#
logs: ## Show containers logs
docker compose logs -f --tail 100
#
# Documentation function (thanks for https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html)
#
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'