-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
69 lines (56 loc) · 1.26 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
export PATH := $(GOPATH)/bin:$(PATH)
export GO111MODULE=on
export GOMAXPROCS=1
GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
GOCLEAN=$(GOCMD) clean
GOGET=$(GOCMD) get
LDFLAGS := -s -w
# application name
PROJECT:=easy-admin
# application version
VERSION := 1.4.0
# application url
URL := https://github.com/nicelizhi/easy-admin
.PHONY: build
all:
make build-ui
make build
# build vue ui
build-ui:
@echo "build node start"
cd ./ui/ && npm run build:prod:base
# build go application
build:
CGO_ENABLED=0 go mod tidy && go build -ldflags="$(LDFLAGS)" -gcflags="all=-c=1" -a -installsuffix "" -o $(PROJECT) .
# make build-linux
build-linux:
make build-ui
make build
@docker build -t $(PROJECT):$(VERSION) .
@echo "build successful"
# build sql go application version
build-sqlite:
go build -tags sqlite3 -ldflags="$(LDFLAGS)" -a -installsuffix -o $(PROJECT) .
clean:
$(GOCLEAN)
rm ./$(PROJECT)
test:
$(GOTEST)
restart:
make stop
make start
.PHONY: start
start:
nohup ./$(PROJECT) server -c=config/settings.dev_steve.yml >> acc.txt &
ps aux | grep "$(PROJECT)"
.PHONY: easy-admin
stop:
pkill $(PROJECT)
# debug file
debug:
dlv debug $(file)
.PHONY: docs
docs:
swag init -g easy-admin.go --parseDependency --parseDepth=6 --instanceName admin -o ./docs/admin