-
Notifications
You must be signed in to change notification settings - Fork 94
/
Makefile
112 lines (89 loc) · 3.72 KB
/
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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Jupiter Golang Application Standard Makefile
SHELL:=/bin/bash
BASE_PATH:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SCRIPT_PATH:=$(BASE_PATH)/script
JUNO_NAME:=juno
JUNO_ADMIN_NAME:=juno-admin
JUNO_PROXY_NAME:=juno-proxy
COMPILE_OUT:=$(BASE_PATH)/release
APP_VERSION:=0.4.0
.DEFAULT_GOAL := default
.PHONY: run run.grpc run.npm
########################################################
database.install:
@go run cmd/juno-admin/main.go --config=config/install.toml --install=true
database.clear:
@go run cmd/juno-admin/main.go --config=config/install.toml --clear=true
database.mock:
@go run cmd/juno-admin/main.go --config=config/install.toml --mock=true
database.debug: database.clear database.install database.mock
run.single-region-admin:
@go run cmd/juno-admin/main.go --config=config/single-region-admin.toml
run.multiple-region-admin:
@go run cmd/juno-admin/main.go --config=config/multiple-region-admin.toml
run.multiple-region-proxy:
@go run cmd/juno-proxy/main.go --config=config/multiple-region-proxy.toml
docker:
@docker-compose -f ./build/docker/standalone.yaml up
all:print fmt lint build_all
print:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making print<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
@echo SHELL:$(SHELL)
@echo BASE_PATH:$(BASE_PATH)
@echo SCRIPT_PATH:$(SCRIPT_PATH)
@echo JUNO_NAME:$(JUNO_NAME)
@echo -e "\n"
fmt:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making fmt<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
go fmt $(JUNO_NAME)/internal/...
@echo -e "\n"
lint:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making lint<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
ifndef REVIVE
go get -u github.com/mgechev/revive
endif
revive -formatter stylish internal/...
@echo -e "\n"
errcheck:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making errcheck<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
ifndef ERRCHCEK
go get -u github.com/kisielk/errcheck
endif
@errcheck internal/...
@echo -e "\n"
test:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making test<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
@echo testPath ${BAST_PATH}
go test -v .${BAST_PATH}/...
build_all:build_clear build_admin build_proxy build_assets build_data tar
build_clear:
rm -rf release
build_admin:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making build juno admin<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
@chmod +x $(SCRIPT_PATH)/build/*.sh
@cd $(BASE_PATH)/cmd/juno-admin && $(SCRIPT_PATH)/build/gobuild.sh $(JUNO_ADMIN_NAME) $(COMPILE_OUT) $(APP_VERSION)
@echo -e "\n"
build_proxy:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making build juno proxy<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
@chmod +x $(SCRIPT_PATH)/build/*.sh
@cd $(BASE_PATH)/cmd/juno-proxy && $(SCRIPT_PATH)/build/gobuild.sh $(JUNO_PROXY_NAME) $(COMPILE_OUT) $(APP_VERSION)
@echo -e "\n"
build_assets:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making build assets<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
@cd $(BASE_PATH)/assets && npm run build
@echo -e "\n"
build_data:
@echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>making build data<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
@chmod +x $(SCRIPT_PATH)/build/*.sh
@$(SCRIPT_PATH)/build/build_data.sh $(JUNO_NAME) $(APP_VERSION) $(BASE_PATH) $(COMPILE_OUT)/$(APP_VERSION)
@echo -e "\n"
tar:
@cd $(BASE_PATH)/release && tar zcvf juno_$(APP_VERSION).tar.gz $(APP_VERSION)
gen-dev-deployment:
kustomize build deployment/overlays/dev > deployment/install.yml
kustomize build deployment/overlays/dev-mirror > deployment/install-mirror.yml
gen-deployment:
kustomize build deployment/overlays/release > deployment/install.yml
kustomize build deployment/overlays/release-mirror > deployment/install-mirror.yml
build-mysql:
cd deployment/dockerfiles/mysql/ && docker build -t mysql:5.7 .