-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
31 lines (21 loc) · 924 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
Version := $(shell date "+%Y%m%d%H%M")
GitCommit := $(shell git rev-parse HEAD)
DIR := $(shell pwd)
LDFLAGS := "-s -w -X main.Version=$(Version) -X main.GitCommit=$(GitCommit)"
run: static-gen doc-gen build
./bin/sync --use_local_dashboard --allow_files=/tmp --allow_files=/usr/lib/systemd/system --allow_files=/etc/nginx --allow_files=/data
run-dashboard:
cd dashboard && npm run serve
build:
go build -ldflags $(LDFLAGS) -o bin/sync *.go
build-release: build-dashboard static-gen
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -o build/release/sync-linux main.go
build-dashboard:
cd dashboard && npm run build
static-gen:
esc -pkg api -o api/static.go -prefix=dashboard/dist dashboard/dist
protocol-gen:
protoc --go_out=plugins=grpc:. protocol/*.proto
doc-gen:
swag init -g api/provider.go
.PHONY: run build protocol-gen doc-gen run-dashboard build-release build-dashboard static-gen