-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (44 loc) · 1.41 KB
/
Makefile
File metadata and controls
60 lines (44 loc) · 1.41 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
#
# Makefile
# edgardleal, 2019-11-30 17:51
#
DONE = echo ✓ $@ done
SOURCES = $(wildcard src/*/*.js)
PROJECTS=\
nginx \
users \
bff
APP_NAME = $(shell cat package.json 2>/dev/null | $(call JSON_GET_VALUE,name))
modules = $(wildcard node_modules/*/*.js)
.PHONY: run all update start clear $(PROJECTS)
all:
docker-compose up nginx
run: all
%/.env: docker-compose.yml # cant be .env.example because will lost config when update
cp "$@.example" $@
echo 'NOTE: You should check each .env file if is accordingly with your environment'
.meta: docker-compose.yml
@mkdir .meta
sanar-users/.env.example: docker-compose.yml
git submodule update --checkout --init --recursive
$(MAKE) update
start: ## start: checkout and update all git submodules
start: all
$(PROJECTS):
docker-compose up -d $@
clear: ## clear: remove all git submodules
@echo $(PROJECTS) | tr ' ' '\n' | xargs -n 1 rm -rf
@$(DONE)
stop: ## stop: stop all containers related to casinha
docker-compose down
docker-clean: ## docker-clean: remove all docker images related to cainha
docker-clean: stop
docker images | grep casinha | awk '{ print $$1 }' | xargs -n 1 docker rmi
docker images | grep '<none>' |awk '{ print $$1 }' | xargs -n 1 docker rmi
hel%: ## help: Show this help message.
@echo "usage: make [target] ..."
@echo ""
@echo "targets:"
@grep -Eh '^.+:\ ##\ .+' ${MAKEFILE_LIST} | cut -d ' ' -f '3-' | column -t -s ':'
# vim:ft=make
#