-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (47 loc) · 1.7 KB
/
Copy pathMakefile
File metadata and controls
60 lines (47 loc) · 1.7 KB
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
VER:='github.com/go-masonry/mortar/mortar.version=v1.2.3'
GIT:='github.com/go-masonry/mortar/mortar.gitCommit=$(shell git rev-parse --short HEAD)'
BUILD_TAG:='github.com/go-masonry/mortar/mortar.buildTag=42'
BUILD_TS:='github.com/go-masonry/mortar/mortar.buildTimestamp=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")'
LDFLAGS=-ldflags
LDFLAGS+="-X ${VER} -X ${GIT} -X ${BUILD_TAG} -X ${BUILD_TS}"
export JAEGER_AGENT_HOST = localhost
export JAEGER_AGENT_PORT = 6831
export JAEGER_SAMPLER_TYPE = const
export JAEGER_SAMPLER_PARAM = 1
run: buf
@go run $(LDFLAGS) -o output/main cmd/api-server/main.go \
config config/config.yml
dev-local: buf
@go run $(LDFLAGS) -o output/main cmd/api-server/main.go \
config config/config.yml \
--additional-files config/config_local.yml
build: buf
go build $(LDFLAGS) -o output/main cmd/api-server/main.go
scf-build:
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o main cmd/api-scf/main.go
scf-deploy:
sls deploy
format:
go fmt ./...
buf format -w
lint:
go vet ./...
buf lint
buf:
@buf generate
@buf generate --template buf.gen.patch.yaml
@go install ./cmd/protoc-gen-kit
@buf generate --template buf.gen.kit.yaml
plugins:
@go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.0
@go install go.einride.tech/aip/cmd/protoc-gen-go-aip@v0.54.1
@go install github.com/envoyproxy/protoc-gen-validate@v0.6.7
@go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0
@go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.10.0
@go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.10.0
@buf generate
@go install ./cmd/protoc-gen-patch
test:
@echo "Testing ..."
@go test -failfast ./...
.PHONY: gen-api test run