forked from frontegg/opensaas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (45 loc) · 1.89 KB
/
Makefile
File metadata and controls
57 lines (45 loc) · 1.89 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
BIN := node_modules/.bin
PATH := $(BIN):$(PATH)
SHELL := /bin/bash
# npm i -g tree-cli
dir-tree:
tree -l 4 -o output.txt --ignore 'node_modules/, .git/, .gitignore'
init:
npm i && npx lerna bootstrap
migrate:
lerna run migrate
seed:
lerna run seed
provision:
lerna run provision
pre-commit:
lerna run pre-commit
prestart:
$(eval docker_down="$(shell docker ps | grep 'Cannot connect to the Docker daemon')")
@if [[ $(docker_down) ]]; then\
echo ;\
echo "////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////";\
echo "//// You don’t have Docker installed / running. //";\
echo "/// Please note that in order to be able to run a full micro-services environment, it is recommended to setup docker including the databases we support. ///";\
echo "// This project will still run and you will enjoy the use of enterprise features but the backend will not be able to connect to the databases ////";\
echo "////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////";\
echo ;\
else\
echo "Docker installed";\
make verify-setup;\
fi
start-frontend:
cd frontend && npm start \
start-backend:
concurrently "npm run start-config-service" "npm run start-metrics-service" "sleep 5 && npm run start-api-gw"
start:
npm run start
verify-setup:
$(eval config="$(shell docker ps | grep -E 'config-service')")
$(eval metrics="$(shell docker ps | grep -E 'metrics-service')")
@if [[ $(config) && $(metrics) ]]; then\
echo "Docker containers are up :)";\
else\
echo "Docker containers are down, runnig docker-compose...";\
lerna run provision;\
fi