-
Notifications
You must be signed in to change notification settings - Fork 490
/
Makefile
41 lines (33 loc) · 1.67 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
.PHONY: openapi
openapi: openapi_http openapi_js
.PHONY: openapi_http
openapi_http:
oapi-codegen -generate types -o internal/trainings/openapi_types.gen.go -package main api/openapi/trainings.yml
oapi-codegen -generate chi-server -o internal/trainings/openapi_api.gen.go -package main api/openapi/trainings.yml
oapi-codegen -generate types -o internal/trainer/openapi_types.gen.go -package main api/openapi/trainer.yml
oapi-codegen -generate chi-server -o internal/trainer/openapi_api.gen.go -package main api/openapi/trainer.yml
oapi-codegen -generate types -o internal/users/openapi_types.gen.go -package main api/openapi/users.yml
oapi-codegen -generate chi-server -o internal/users/openapi_api.gen.go -package main api/openapi/users.yml
.PHONY: openapi_js
openapi_js:
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.0 generate \
-i /local/api/openapi/trainings.yml \
-g javascript \
-o /local/web/src/repositories/clients/trainings
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.0 generate \
-i /local/api/openapi/trainer.yml \
-g javascript \
-o /local/web/src/repositories/clients/trainer
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.0 generate \
-i /local/api/openapi/users.yml \
-g javascript \
-o /local/web/src/repositories/clients/users
.PHONY: proto
proto:
protoc --go_out=plugins=grpc:internal/common/genproto/trainer -I api/protobuf api/protobuf/trainer.proto
protoc --go_out=plugins=grpc:internal/common/genproto/users -I api/protobuf api/protobuf/users.proto
.PHONY: lint
lint:
@./scripts/lint.sh trainer
@./scripts/lint.sh trainings
@./scripts/lint.sh users