-
Notifications
You must be signed in to change notification settings - Fork 136
/
Copy pathMakefile
58 lines (42 loc) · 1.25 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
.PHONY: swagger_spec yarn_dependencies swagger_client ui server run dev lint
DASHBOARD_PKG := github.com/pingcap-incubator/tidb-dashboard
BUILD_TAGS ?=
SKIP_YARN_INSTALL ?=
LDFLAGS ?=
ifeq ($(SWAGGER),1)
BUILD_TAGS += swagger_server
endif
ifeq ($(UI),1)
BUILD_TAGS += ui_server
endif
LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils.ReleaseVersion=$(shell git describe --tags --dirty)"
LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils.BuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S')"
LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils.GitHash=$(shell git rev-parse HEAD)"
LDFLAGS += -X "$(DASHBOARD_PKG)/pkg/utils.GitBranch=$(shell git rev-parse --abbrev-ref HEAD)"
default:
SWAGGER=1 make server
lint:
scripts/lint.sh
dev: lint default
swagger_spec:
scripts/generate_swagger_spec.sh
yarn_dependencies:
cd ui &&\
yarn install --frozen-lockfile
swagger_client: swagger_spec yarn_dependencies
cd ui &&\
npm run build_api_client
ui: swagger_client
cd ui &&\
src/apps/keyvis/download_dummydata.sh &&\
REACT_APP_DASHBOARD_API_URL="" npm run build
server:
ifeq ($(SWAGGER),1)
make swagger_spec
endif
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