-
Notifications
You must be signed in to change notification settings - Fork 133
/
Makefile
66 lines (48 loc) · 1.39 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
59
60
61
62
63
64
65
66
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test ./...
GOGET=$(GOCMD) get
BINARY_NAME=ops
all: deps test build
pre-build:
do-build: pre-build
$(GOBUILD) -o $(BINARY_NAME) -v
post-build: do-build
build: post-build
pre-test:
do-test: pre-test
@GO111MODULE=on $(GOTEST) -v
post-test: do-test
test: post-test
# go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
# go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
# go install github.com/bufbuild/buf/cmd/buf@latest
generate:
buf generate --path ./protos/imageservice/imageservice.proto
buf generate --path ./protos/instanceservice/instanceservice.proto
buf generate --path ./protos/volumeservice/volumeservice.proto
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -rf protos/imageservice/*.go
rm -rf protos/imageservice/*.json
rm -rf protos/instanceservice/*.go
rm -rf protos/instanceservice/*.json
rm -rf protos/volumeservice/*.go
rm -rf protos/volumeservice/*.json
run:
$(GOBUILD) -o $(BINARY_NAME) -v .
./$(BINARY_NAME)
deps:
@GO111MODULE=on go mod download
# go install github.com/golang/mock/mockgen@latest
update-mocks:
go generate network/setup_network_interfaces.go
go generate provider/upcloud/upcloud.go
go generate provider/oci/oci.go
.PHONY: all build test clean run deps
.PHONY: pre-build do-build post-build
.PHONY: pre-test do-test post-test
-include Makefile.local