-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (46 loc) · 1.45 KB
/
Makefile
File metadata and controls
60 lines (46 loc) · 1.45 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
.DEFAULT_GOAL := build
DATE=`date --rfc-3339=seconds`
COMMIT=`git log -n 1 --pretty=format:"%H"`
BUILD_VERSION=v1.1.0
.PHONY: log
log:
echo $(DATE) $(COMMIT)
.PHONY: build
build:
go build -o api-gateway.o -ldflags "-X main.buildVersion=$(BUILD_VERSION) -X 'main.buildDate=$(DATE)' -X main.buildCommit=$(COMMIT)" ./cmd/api-gateway
.PHONY: gox
gox:
gox -ldflags "-X main.buildVersion=$(BUILD_VERSION) -X 'main.buildDate=$(DATE)' -X main.buildCommit=$(COMMIT)" -output ./bin/{{.Dir}}_{{.OS}}_{{.Arch}} ./...
.PHONY: gen/proto
gen/proto:
protoc --go_out=. --go_opt=paths=import \
--go-grpc_out=. --go-grpc_opt=paths=import \
./api/*.proto
.PHONY: gen
gen: gen/proto
go generate ./...
.PHONY: test
test:
go test ./... -v -coverpkg=./internal/... -coverprofile=coverage.out
.PHONY: testshort
testshort:
go test ./... -v -test.short=true -coverpkg=./internal/... -coverprofile=coverage.out
.PHONY: c
c:
go tool cover -func coverage.out
.PHONY: tc
tc: testshort c
.PHONY: lines
lines:
git ls-files | xargs wc -l
.PHONY: dock
dock:
docker build -f infra/server.dockerfile . --tag="vladmarlo/hell_kitchen_gateway:latest"
docker build -f infra/ingredients.dockerfile . --tag="vladmarlo/hell_kitchen_ingredients_creator:latest"
.PHONY: dock/push
dock/push:
docker push vladmarlo/hell_kitchen_gateway:latest
docker push vladmarlo/hell_kitchen_ingredients_creator:latest
.PHONY: dock/run
dock/run:
docker compose -f infra/compose.yaml up -d