Yimaru-BackEnd/makefile
2025-03-29 06:25:19 +03:00

33 lines
723 B
Makefile

include .env
.PHONY: test
test:
go test ./app
.PHONY: coverage
coverage:
mkdir -p coverage
go test -coverprofile=coverage.out ./internal/... ;
go tool cover -func=coverage.out -o coverage/coverage.txt
.PHONY: build
build:
go build -ldflags="-s" -o ./bin/web ./
.PHONY: run
run:
@echo "Running Go application"; \
go run ./cmd/main.go
.PHONY: air
air:
@echo "Running air"; \
air -c .air.toml
.PHONY: migrations/up
migrations/new:
@echo 'Creating migration files for DB_URL'
migrate create -seq -ext=.sql -dir=./db/migrations $(name)
.PHONY: migrations/up
migrations/up:
@echo 'Running up migrations...'
migrate -path ./db/migrations -database $(DB_URL) up
.PHONY: swagger
swagger:
swag init -g cmd/main.go