forked from hyperledger-cello/cello
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (61 loc) · 1.97 KB
/
Makefile
File metadata and controls
79 lines (61 loc) · 1.97 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
75
76
77
78
79
GREEN := $(shell tput -Txterm setaf 2)
WHITE := $(shell tput -Txterm setaf 7)
YELLOW := $(shell tput -Txterm setaf 3)
RESET := $(shell tput -Txterm sgr0)
THEME?=basic
STATIC_FOLDER?=themes\/${THEME}\/static
TEMPLATE_FOLDER?=themes\/${THEME}\/templates
.PHONY: \
all \
check \
clean \
log \
logs \
redeploy \
restart \
setup \
start \
stop \
all: check
check: ##@Code Check code format
tox
clean: ##@Code Clean tox result
rm -rf .tox
# Use like "make log service=dashboard"
log: ##@Log tail special service log, Use like "make log service=dashboard"
docker-compose logs -f ${service} --tail=100
logs:
docker-compose logs -f --tail=100
# Use like "make redeploy service=dashboard"
redeploy: ##@Service Redeploy single service, Use like "make redeploy service=dashboard"
bash scripts/redeploy.sh ${service}
initial-env: ##@Configuration Initial Configuration for dashboard
sed -i 's/\(STATIC_FOLDER=\).*/\1${STATIC_FOLDER}/' .env
sed -i 's/\(TEMPLATE_FOLDER=\).*/\1${TEMPLATE_FOLDER}/' .env
start: ##@Service Start service
@$(MAKE) initial-env
bash scripts/start.sh
stop: ##@Service Stop service
bash scripts/stop.sh
restart: stop start ##@Service Restart service
setup: ##@Environment Setup dependency for service environment
bash scripts/setup.sh
build-js: ##@Nodejs Build js files for react
bash scripts/build_reactjs.sh
watch-mode: ##@Nodejs Run watch mode with js files for react
bash scripts/watch_mode.sh
npm-install: ##@Nodejs Install modules with npm package management
bash scripts/npm_install.sh
HELP_FUN = \
%help; \
while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([a-zA-Z\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
print "usage: make [target]\n\n"; \
for (sort keys %help) { \
print "${WHITE}$$_:${RESET}\n"; \
for (@{$$help{$$_}}) { \
$$sep = " " x (32 - length $$_->[0]); \
print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
}; \
print "\n"; }
help: ##@other Show this help.
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)