-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (61 loc) · 1.87 KB
/
Makefile
File metadata and controls
76 lines (61 loc) · 1.87 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
# Download Booty
BOOTY_URL := https://raw.githubusercontent.com/amplify-edge/booty/master/scripts
ifeq ($(OS),Windows_NT)
BOOTY_URL:=$(BOOTY_URL)/install.ps1
else
BOOTY_URL:=$(BOOTY_URL)/install.sh
endif
SHELLCMD :=
ADD_PATH :=
ifeq ($(OS),Windows_NT)
SHELLCMD:=powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "Invoke-WebRequest -useb $(BOOTY_URL) | Invoke-Expression"
ADD_PATH:=export PATH=$$PATH:"/C/booty" # workaround for github CI
else
SHELLCMD:=curl -fsSL $(BOOTY_URL) | bash
ADD_PATH:=echo $$PATH
endif
all: print dep build print-end
## Print all settings
print:
@echo
@echo "-- SYS: start --"
@echo BIN_FOLDER: $(BIN_FOLDER)
@echo SDK_BIN: $(SDK_BIN)
@echo SERVER_BIN: $(SERVER_BIN)
@echo
print-end:
@echo
@echo "-- SYS: end --"
@echo
@echo
dep:
@echo $(BOOTY_URL)
$(SHELLCMD)
$(ADD_PATH)
booty install-all
booty extract includes
### BUILD
build: build-delete #config-gen
cd sys-account && $(MAKE) all
cd sys-core && $(MAKE) all
build-delete:
rm -rf $(BIN_FOLDER)
config-gen: config-delete config-dep
@echo Generating Config
@mkdir -p ./config
@booty jsonnet -S $(EXAMPLE_SERVER_DIR)/sysaccount.jsonnet \
-V SYS_ACCOUNT_DB_ENCRYPT_KEY=$(EXAMPLE_SYS_CORE_DB_ENCRYPT_KEY) \
-V SYS_ACCOUNT_FILEDB_ENCRYPT_KEY=$(EXAMPLE_SYS_FILE_DB_ENCRYPT_KEY) \
-V SYS_ACCOUNT_SENDGRID_API_KEY=$(shell echo ${SENDGRID_API_KEY}) > $(EXAMPLE_SYS_ACCOUNT_CFG_PATH)
config-dep:
cd $(EXAMPLE_SERVER_DIR) && booty jb install && booty jb update
cd sys-account/service/go && booty jb install && booty jb update
cd sys-core/service/go && booty jb install && booty jb update
config-delete:
@echo Deleting previously generated config
rm -rf $(EXAMPLE_SYS_CORE_CFG_PATH)
rm -rf $(EXAMPLE_SYS_ACCOUNT_CFG_PATH)
gen-cert: gen-cert-delete
@mkdir -p $(EXAMPLE_CERT_DIR)
gen-cert-delete:
rm -rf $(EXAMPLE_CERT_DIR)/*.{pem,key,csr,crt}