-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
42 lines (31 loc) · 929 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
NAME = kansa
BASE_CFG = config/docker-compose.base.yaml
DEV_CFG = config/docker-compose.dev.yaml
PROD_CFG = config/docker-compose.prod.yaml
PROD_CFG_TMPL = config/docker-compose.prod-template.yaml
DC = docker-compose -f $(BASE_CFG) -f $(DEV_CFG) -p $(NAME)
start:
$(DC) up --build
start-detached:
$(DC) up -d --build
update-%:
$(DC) up -d --build --no-deps $*
stop:
$(DC) stop
test-reset:
docker exec kansa_postgres_1 psql api kansa -c "SELECT reset_test_users();"
test: test-reset | integration-tests/node_modules
cd integration-tests && npm test
@${MAKE} test-reset
integration-tests/node_modules:
cd integration-tests && npm install
prod: prod-check
$(DC) up -d --build
prod-check: | $(PROD_CFG)
@grep '^\s\+[A-Z_]\+:\s*$$' $(PROD_CFG) ;\
if [ $$? -eq 0 ] ; then \
echo "Empty env var values not allowed in $(PROD_CFG)" ;\
exit 1 ;\
fi
$(PROD_CFG): $(PROD_CFG_TMPL)
cp $(PROD_CFG_TMPL) $(PROD_CFG)