forked from eoscostarica/lifebank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
75 lines (64 loc) · 1.93 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
include utils/meta.mk utils/help.mk
SHELL := /bin/bash
run: ##@local Run the project locally
run:
make run-env
make run-postgres
make run-wallet
make -j 3 run-hapi run-hasura run-webapp
run-env:
@[ -f .env ] && source .env || echo "$(YELLOW)WARNING:$(RESET) .env file not found"
run-postgres:
@docker-compose up -d --build postgres
run-wallet:
@docker-compose up -d --build wallet
run-hapi:
@cd hapi && yarn
@docker-compose up -d --build hapi
@if [ $(STAGE) = "dev" ]; then\
docker-compose logs -f hapi;\
fi
run-hasura:
@until \
docker-compose exec -T postgres pg_isready; \
do echo "$(BLUE)$(STAGE)-$(APP_NAME)-hasura |$(RESET) waiting for postgres service"; \
sleep 5; done;
@until \
curl http://localhost:9090; \
do echo "$(BLUE)$(STAGE)-$(APP_NAME)-hasura |$(RESET) waiting for hapi service"; \
sleep 5; done;
@docker-compose stop hasura
@docker-compose up -d --build hasura
@until \
curl http://localhost:8080/v1/version; \
do echo "$(BLUE)$(STAGE)-$(APP_NAME)-hasura |$(RESET) ..."; \
sleep 5; done;
@if [ $(STAGE) = "dev" ]; then\
cd hasura;\
hasura console --endpoint http://localhost:8080 --no-browser;\
fi
run-webapp:
@until \
curl http://localhost:8080/v1/version; \
do echo "$(BLUE)$(STAGE)-$(APP_NAME)-webapp |$(RESET) waiting for hasura service"; \
sleep 5; done;
@if [ $(STAGE) = "dev" ]; then\
cd webapp && yarn;\
FORCE_COLOR=true yarn start | cat;\
else\
docker-compose up -d --build webapp;\
docker-compose up -d --build nginx;\
fi
stop: ##@local Stops the development instance
stop:
@docker-compose stop
install: ##@local Install hapi and webapp dependencies
install:
@cd hapi && yarn
@cd webapp && yarn
pre-commit: ##@local Run pre commit validations for hapi and webapp
pre-commit:
@[ ! -d hapi/node_modules ] && cd hapi && yarn || echo ""
@cd hapi && yarn format && yarn lint
@[ ! -d webapp/node_modules ] && cd webapp && yarn || echo ""
@cd webapp && yarn format && yarn lint