-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (45 loc) · 1018 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
43
44
45
46
47
48
49
50
51
BASE_PATH := $(shell pwd)
CMD_PATH := "cmd"
CMD_DIRS := $(shell find $(CMD_PATH)/* -type d)
GO_COMPILE:=GOOS=linux GOARCH=amd64 go build
.SILENT:
init:
echo "ℹ️ INITIALIZING PROJECT..."
npm install
go mod tidy
ifdef profile
cdk bootstrap --profile ${profile}
else
cdk bootstrap
endif
.PHONY: clean compile_all
clean:
echo "ℹ️ CLEANING ALL BUILD FILES..."
for base in $(CMD_DIRS); do \
dirname=$$(basename $$base); \
cd $(BASE_PATH)/$$base && \
if [ -f $(BASE_PATH)/$$base/bootstrap ]; then \
echo "- $$dirname"; \
rm bootstrap; \
fi; \
done
echo "\n"
compile_all: clean
echo "ℹ️ STARTING TO COMPILE ALL..."
for base in $(CMD_DIRS); do \
dirname=$$(basename $$base); \
cd $(BASE_PATH)/$$base && \
if [ -s main.go ]; then \
echo "- $$dirname"; \
cd $(BASE_PATH)/$$base && \
$(GO_COMPILE) -o bootstrap main.go; \
fi; \
done
echo "\n"
deploy: compile_all
echo "🚀 Deploying stack..."
ifdef profile
cdk deploy --profile ${profile}
else
cdk deploy
endif