-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
47 lines (34 loc) · 1.23 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
VERSION := $(shell git describe --always --dirty --tag)
COMMIT := $(shell git describe --always --long)
REPO := overmike/webterminal
#EXTRA_LDFLAGS := -s -w
EXTRA_LDFLAGS :=
LDFLAGS := -X github.com/${REPO}/cmd.version=${VERSION} -X github.com/${REPO}/cmd.commit=${COMMIT} ${EXTRA_LDFLAGS}
webterminal:
go build -v -ldflags="${LDFLAGS}"
clean:
rm webterminal
proto_gen:
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go
proto:
protoc -I/usr/local/include -I./pb/ \
-I./pb/googleapis/ \
--go_out=plugins=grpc:terminal/ \
--grpc-gateway_out=logtostderr=true:terminal/ \
--swagger_out=logtostderr=true:terminal/ \
pb/terminal.proto
web:
yarn --cwd js
yarn --cwd js build
rice:
go get -u github.com/GeertJohan/go.rice/rice
asset: web
rice -i github.com/${REPO}/cmd embed-go
docker:
docker build --build-arg LDFLAGS="${LDFLAGS}" --target assetbuilder -t ${REPO}:assetbuilder .
docker build --build-arg LDFLAGS="${LDFLAGS}" --target builder -t ${REPO}:builder .
docker build --build-arg LDFLAGS="${LDFLAGS}" -t ${REPO} .
docker tag ${REPO} ${REPO}:${VERSION}
.PHONY: proto_gen proto