forked from GoogleCloudPlatform/config-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (29 loc) · 799 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
31
32
33
34
35
36
37
PROTO_DOCKER_IMAGE=gcv-proto-builder
PLATFORMS := linux windows darwin
BUILD_DIR=./bin
NAME=config-validator
.PHONY: proto-builder
proto-builder:
docker build -t $(PROTO_DOCKER_IMAGE) -f ./build/proto/Dockerfile .
.PHONY: proto
proto: proto-builder
docker run \
-v `pwd`:/go/src/github.com/forseti-security/config-validator \
$(PROTO_DOCKER_IMAGE) \
protoc -I/proto -I./api --go_out=plugins=grpc:./pkg/api/validator ./api/validator.proto
.PHONY: test
test:
GO111MODULE=on go test ./...
.PHONY: build
build: format proto
.PHONY: release
release: $(PLATFORMS)
.PHONY: $(PLATFORMS)
$(PLATFORMS):
GO111MODULE=on GOOS=$@ GOARCH=amd64 CGO_ENABLED=0 go build -o "${BUILD_DIR}/${NAME}-$@-amd64" cmd/server/main.go
.PHONY: clean
clean:
rm bin/${NAME}*
.PHONY: format
format:
go fmt ./...