This repository was archived by the owner on Jun 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (58 loc) · 1.49 KB
/
Makefile
File metadata and controls
74 lines (58 loc) · 1.49 KB
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
# Change this so that it matches your container name / id
CONTAINER_NAME ?= graphql_koa_typescript
log = @echo "[make] $(1)"
exec = docker exec -it $(CONTAINER_NAME) sh -c $(1)
infra:
$(call log, "Starting docker containers")
docker-compose up -d
enter:
$(call log, "Entering container terminal")
docker exec -it $(CONTAINER_NAME) sh
enter:
$(call log, "Entering container terminal")
docker exec -it $(CONTAINER_NAME) sh
node_modules:
$(call log, "Installing dependencies")
$(call exec, "rm -rf node_modules")
$(call exec, "yarn cache clean --force")
$(call exec, "yarn install")
build:
$(call log, "Building")
$(call exec, "yarn build")
dev:
$(call log, "Starting dev server")
$(call exec, "yarn dev")
db-migrate:
$(call log, "Database migration")
$(call exec, "yarn db:migrate")
db-rollback:
$(call log, "Database rollback")
$(call exec, "yarn db:rollback")
db-reset: db-rollback db-migrate
db-seed:
$(call log, "Database seed")
$(call exec, "yarn db:seed")
test:
$(call log, "Running tests")
$(call exec, "NODE_ENV=test yarn db:rollback")
$(call exec, "NODE_ENV=test yarn db:migrate")
$(call exec, "NODE_ENV=test yarn test")
test-coverage:
$(call log, "Running tests")
$(call exec, "NODE_ENV=test yarn db:rollback")
$(call exec, "NODE_ENV=test yarn db:migrate")
$(call exec, "NODE_ENV=test yarn test:coverage")
rules := \
infra \
enter \
node_modules \
build \
dev \
db-migrate \
db-rollback \
db-reset \
db-seed \
test \
node_modules \
test-coverage \
.PHONY: $(rules)