chore: add Makefile
This commit is contained in:
parent
7417c38798
commit
096a044e5d
1 changed files with 51 additions and 0 deletions
51
Makefile
Normal file
51
Makefile
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
.PHONY: codegen
|
||||
codegen:
|
||||
@echo "Generating code..."
|
||||
@oapi-codegen --config=./oapi-codegen.cli.yaml ./api/v1/openapi.yaml
|
||||
|
||||
POSTGRES_URL="pgx5://backoffice_api_dev_user:xxx@localhost:5432/backoffice_api_dev?sslmode=disable"
|
||||
|
||||
.PHONY: create-migration
|
||||
create-migration:
|
||||
migrate create -ext sql -dir ./db/migrations -seq -digits 4 ${name}
|
||||
|
||||
.PHONY: local-migrate-up
|
||||
local-migrate-up:
|
||||
migrate -database ${POSTGRES_URL} -path ./db/migrations up
|
||||
|
||||
.PHONY: local-migrate-force
|
||||
local-migrate-force:
|
||||
migrate -database ${POSTGRES_URL} -path ./db/migrations force
|
||||
|
||||
.PHONY: local-migrate-down
|
||||
local-migrate-down:
|
||||
migrate -database ${POSTGRES_URL} -path ./db/migrations down
|
||||
|
||||
.PHONY: local-migrate-drop
|
||||
local-migrate-drop:
|
||||
migrate -database ${POSTGRES_URL} -path ./db/migrations drop -f
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
@go test -v -json ./... | tparse -all
|
||||
|
||||
.PHONY: verbose-test
|
||||
verbose-test:
|
||||
@go test -v -cover ./...
|
||||
|
||||
.PHONY: coverage
|
||||
coverage:
|
||||
@go test -v -cover -json ./... | tparse
|
||||
|
||||
.PHONY: build-docker-api
|
||||
build-docker-api:
|
||||
docker build -t backoffice-api -f ./build/package/api/Dockerfile .
|
||||
|
||||
.PHONY: build-docker-migrations
|
||||
build-docker-migrations:
|
||||
docker build -t vmcr.cz/backoffice-api/migrations -f ./build/package/migrations/Dockerfile .
|
||||
|
||||
.PHONY: helm-test
|
||||
helm-test:
|
||||
helm lint ./deploy
|
||||
helm template api ./deploy --values ./deploy/values.test.yaml
|
||||
Reference in a new issue