forked from pingcap/tidb-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (32 loc) · 1.08 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
.PHONY: install_tools lint dev yarn_dependencies ui server run
DASHBOARD_PKG := github.com/pingcap/tidb-dashboard
BUILD_TAGS ?=
LDFLAGS ?=
ifeq ($(UI),1)
BUILD_TAGS += ui_server
endif
LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils/version.InternalVersion=$(shell grep -v '^\#' ./release-version)"
LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils/version.Standalone=Yes"
LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils/version.PDVersion=N/A"
LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils/version.BuildTime=$(shell date -u '+%Y-%m-%d %I:%M:%S')"
LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils/version.BuildGitHash=$(shell git rev-parse HEAD)"
default: server
install_tools:
scripts/install_go_tools.sh
lint:
scripts/lint.sh
dev: lint default
yarn_dependencies: install_tools
cd ui &&\
yarn install --frozen-lockfile
ui: yarn_dependencies
cd ui &&\
yarn build
server: install_tools
scripts/generate_swagger_spec.sh
ifeq ($(UI),1)
scripts/embed_ui_assets.sh
endif
go build -o bin/tidb-dashboard -ldflags '$(LDFLAGS)' -tags "${BUILD_TAGS}" cmd/tidb-dashboard/main.go
run:
bin/tidb-dashboard --debug --experimental