-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (38 loc) · 1.31 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
.PHONY: build test log
LOG_TAIL := $(if $(tail),$(tail),"all")
BUILD_CACHE_STATE := $(if $(no-cache),--no-cache,)
CONTAINER := $(if $(container),$(container))
SHELL_CONTAINER := $(if $(container),$(container),app)
BACKGROUND_START := $(if $(fg),,-d)
DEPS := $(if $(packages),$(packages),)
MIGRATION_NAME = ""
all: clean stop build install
re: down all
build:
docker-compose build ${BUILD_CACHE_STATE} ${CONTAINER}
start:
docker-compose up ${BACKGROUND_START} ${CONTAINER}
stop:
docker-compose stop ${CONTAINER}
down:
docker-compose down -v
log:
docker-compose logs -f -t --tail=${LOG_TAIL} ${CONTAINER}
ps:
docker-compose ps
shell:
docker-compose run --rm ${SHELL_CONTAINER} sh
clean:
rm -rf node_modules dist
install:
docker-compose run --rm app npm install
test:
docker-compose -f docker-compose.test.yml run --rm test tech-docker-compose ✭ ◼
migrate-create:
docker-compose run --rm app npm run migration:create
migrate-generate:
docker-compose run --rm app npm run migration:generate ${MIGRATION_NAME}
migrate-run-dev:
docker-compose run --rm app npm run migration:run
migrate-run-prod:
docker-compose run --rm app npm run migration:run:prod