56 lines
1.5 KiB
Makefile
56 lines
1.5 KiB
Makefile
.PHONY: codegen
|
|
codegen:
|
|
@echo "Generating code..."
|
|
@oapi-codegen --config=./oapi-codegen.cli.yaml ./api/v1/openapi.yaml
|
|
|
|
POSTGRES_URL="pgx5://yggdrasil_user:yggdrasil@localhost:5432/yggdrasil?sslmode=disable"
|
|
|
|
.PHONY: create-migration
|
|
create-migration:
|
|
migrate create -ext sql -dir ./db/migrations -seq -digits 3 ${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: local-db-seed
|
|
local-db-seed:
|
|
@echo "Seeding database..."
|
|
@APP_ENV="development" DATABASE_URL_FILE="secrets/postgres_url" go run ./cmd/seed/main.go
|
|
|
|
.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-httpserver
|
|
build-docker-httpserver:
|
|
docker build -t yggdrasil-httpserver -f ./build/package/httpserver/Dockerfile .
|
|
|
|
.PHONY: build-docker-migrations
|
|
build-docker-migrations:
|
|
docker build -t yggdrasil-migrations -f ./build/package/migrations/Dockerfile .
|
|
|
|
.PHONY: helm-test
|
|
helm-test:
|
|
helm lint ./deploy
|
|
helm template api ./deploy --values ./deploy/values.test.yaml
|