forked from LyricTian/gin-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (25 loc) · 840 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
.PHONY: start build-server build-web
NOW = $(shell date -u '+%Y%m%d%I%M%S')
SERVER_BIN = "./cmd/server/server"
RELEASE_ROOT = "release"
RELEASE_SERVER = "release/ginadmin"
all: start
build-server:
@go build -ldflags "-w -s" -o $(SERVER_BIN) ./cmd/server
build-web:
cd web && yarn && yarn run build
build: build-server build-web
start: build-server build-web
$(SERVER_BIN) -c ./config/config.toml -m ./config/model.conf -www ./web/dist
start-server:
@go build -o $(SERVER_BIN) ./cmd/server
$(SERVER_BIN) -c ./config/config.toml -m ./config/model.conf
start-web:
cd web && yarn && yarn start
test:
@go test -cover -race ./...
pack: build-server build-web
rm -rf $(RELEASE_ROOT)
mkdir -p $(RELEASE_SERVER)
cp -r $(SERVER_BIN) config web/dist $(RELEASE_SERVER)
cd $(RELEASE_ROOT) && zip -r ginadmin.$(NOW).zip "ginadmin"