-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
77 lines (59 loc) · 1.72 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
67
68
69
70
71
72
73
74
75
76
77
REGISTRY=cvcio
PROJECT=rtaa-72
TAG=`cat VERSION`
BUF_VERSION=1.7.0
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
REG_PROJ=$(REGISTRY)/$(PROJECT)-$(MODULE)
REG_TAG=$(REGISTRY)/$(PROJECT)-$(MODULE):$(TAG)
SERVICES=app stream
keys:
openssl req \
-newkey rsa:2048 \
-nodes -keyout server-key.key \
-x509 -out server-cert.pem \
-addext "subjectAltName = DNS:localhost"
tools:
go get github.com/oxequa/realize
go get github.com/golangci/golangci-lint
buf-install:
curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-$(shell uname -s)-$(shell uname -m)" \
-o "$(shell go env GOPATH)/bin/buf" && \
chmod +x "$(shell go env GOPATH)/bin/buf"
buf-generate:
buf generate --template buf.gen.yaml
buf-update:
buf mod update
buf-lint:
buf lint
proto: buf-update buf-lint buf-generate
swag:
swagger serve swagger/*.json
run-app:
cd cmd/app; yarn serve
run-stream:
realize start -n stream
test:
go test -v ./...
lint:
golangci-lint run -e vendor
services-build:
for name in ${SERVICES}; do\
cp cmd/$$name/Dockerfile.$$name .;\
echo "Building image $$name";\
docker build -f Dockerfile.$$name --rm -t $(REGISTRY)/$(PROJECT)-$$name:$(TAG) .;\
docker tag $(REGISTRY)/$(PROJECT)-$$name:$(TAG) $(REGISTRY)/$(PROJECT)-$$name:latest;\
rm Dockerfile.$$name;\
done
services-push:
for name in ${SERVICES}; do\
docker push $(REGISTRY)/$(PROJECT)-$$name:$(TAG);\
docker push $(REGISTRY)/$(PROJECT)-$$name:latest;\
done
services-run:
docker-compose -f docker-compose.yaml up
services: services-build services-run
# This included makefile should define the 'custom' target rule which is called here.
include $(INCLUDE_MAKEFILE)
.PHONY: release
release: custom