2023-06-22 09:36:43 +00:00
|
|
|
help: ## show this help
|
|
|
|
@echo 'usage: make [target] ...'
|
|
|
|
@echo ''
|
|
|
|
@echo 'targets:'
|
|
|
|
@egrep '^(.+)\:\ .*##\ (.+)' ${MAKEFILE_LIST} | sed 's/:.*##/#/' | column -t -c 2 -s '#'
|
|
|
|
|
|
|
|
install: ## install all go dependencies
|
|
|
|
go get \
|
|
|
|
github.com/bufbuild/buf/cmd/buf \
|
|
|
|
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
|
|
|
|
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
|
|
|
|
google.golang.org/grpc/cmd/protoc-gen-go-grpc \
|
|
|
|
google.golang.org/protobuf/cmd/protoc-gen-go
|
|
|
|
|
|
|
|
generate: ## generate grpc proto for golang
|
|
|
|
buf generate
|
2024-05-20 19:43:37 +00:00
|
|
|
# oapi-codegen --config ./api/openapi/v1/api.yaml ./api/openapi/v1/openapi.yaml
|
|
|
|
# oapi-codegen --config ./api/openapi/v1/models.yaml ./api/openapi/v1/openapi.yaml
|
2023-06-22 09:36:43 +00:00
|
|
|
|
|
|
|
test: ## run all layers tests
|
|
|
|
@make test.unit
|
|
|
|
@make test.integration
|
|
|
|
|
|
|
|
test.unit: ## run unit tests
|
|
|
|
go test ./...
|
|
|
|
|
|
|
|
test.integration: ## run integration tests
|
2023-11-01 07:56:05 +00:00
|
|
|
go mod vendor
|
2023-06-22 09:36:43 +00:00
|
|
|
@make test.integration.up
|
|
|
|
@make test.integration.start
|
|
|
|
@make test.integration.down
|
|
|
|
|
|
|
|
test.integration.up: ## build integration test environment
|
2023-11-01 08:59:11 +00:00
|
|
|
docker-compose -f deployments/test/docker-compose.yaml up -d --remove-orphans
|
2023-06-22 09:36:43 +00:00
|
|
|
|
|
|
|
test.integration.down: ## shutting down integration environment
|
2023-11-01 08:59:11 +00:00
|
|
|
docker-compose -f deployments/test/docker-compose.yaml down --volumes
|
2023-09-14 10:07:28 +00:00
|
|
|
|
|
|
|
test.integration.start: ## run integration test
|
2023-11-06 07:34:07 +00:00
|
|
|
go test -count=1 ./tests/integration/...
|
2023-09-14 10:07:28 +00:00
|
|
|
|
|
|
|
test.e2e.start: ## run integration test
|
|
|
|
go test ./tests/e2e/...
|
2023-06-22 09:36:43 +00:00
|
|
|
|
|
|
|
run: ## run app
|
|
|
|
go run ./cmd/app/main.go
|
|
|
|
|
|
|
|
dev.up: ## run dev environment
|
|
|
|
docker-compose -f deployments/dev/docker-compose.yaml up -d
|
|
|
|
|
|
|
|
dev.down: ## shutting down dev environment
|
2023-11-01 07:56:05 +00:00
|
|
|
docker-compose -f deployments/dev/docker-compose.yaml down --volumes --rmi local
|