-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
71 lines (48 loc) · 1.86 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
.PHONY: re-generate-cert clean-assets client-assets server-assets assets build-client build-server build-docker deploy remove-ds-store
export SHELL := env PWD=$(CURDIR) bash
ifeq ($(SHELL),)
$(error bash is required)
endif
BUILDTAGS=debug
OS=linux
CLIENT_MAIN_LOCATION=$(PWD)/cmd/client
SERVER_MAIN_LOCATION=$(PWD)/cmd/server
CLIENT_BUILD_OUTPUT=$(PWD)/build/package/release/client
SERVER_BUILD_OUTPUT=$(PWD)/build/package/release/server
BUILD_DEPLOY_PATH=$(PWD)/build/package/deploy
DOCKER_IMAGE='0raymond0/ngrok-space:latest'
re-generate-cert:
bash scripts/recreate-cert.sh
clean-assets:
rm -rf internal/app/client/assets/ internal/app/server/assets/
client-assets: BUILDTAGS=release
client-assets:
scripts/go-bindata -nomemcopy -pkg=assets -tags=$(BUILDTAGS) \
-debug=$(if $(findstring debug,$(BUILDTAGS)),true,false) \
-o=./internal/app/client/assets/assets_$(BUILDTAGS).go \
assets/client/...
server-assets: BUILDTAGS=release
server-assets:
scripts/go-bindata -nomemcopy -pkg=assets -tags=$(BUILDTAGS) \
-debug=$(if $(findstring debug,$(BUILDTAGS)),true,false) \
-o=./internal/app/server/assets/assets_$(BUILDTAGS).go \
assets/server/...
assets: client-assets server-assets
build-client:
bash build/package/client/build.sh $(OS) $(CLIENT_MAIN_LOCATION) $(CLIENT_BUILD_OUTPUT)
build-client-linux: OS=linux
build-client-linux: build-client
build-client-macos: OS=macos
build-client-macos: build-client
build-client-windows: OS=windows
build-client-windows: build-client
build-client-arm: OS=linux-arm
build-client-arm: build-client
build-server:
bash build/package/server/build.sh $(OS) $(SERVER_MAIN_LOCATION) $(SERVER_BUILD_OUTPUT)
build-docker:
bash scripts/docker-build.sh $(SERVER_BUILD_OUTPUT) $(BUILD_DEPLOY_PATH) $(DOCKER_IMAGE)
deploy: build-docker
bash scripts/deploy.sh $(PWD)/deployments
remove-ds-store:
find . -name ".DS_Store" -delete