123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- include .env
- GOOSE_DB_STRING = ${DB_USER}:${DB_PASSWORD}@tcp\(${DB_HOST}:${DB_PORT}\)/${DB_NAME}
- run:
- cd cmd/app && go run main.go
- test:
- go test ./...
- test-cover:
- go clean -testcache
- go test ./... -coverprofile=coverage.tmp.out -covermode count -coverpkg=git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/services/handler/...
- grep -v 'mocks\|config' coverage.tmp.out > coverage.out
- rm coverage.tmp.out
- go tool cover -html=coverage.out;
- lint:
- golangci-lint run --timeout=3m
- migration-status:
- goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} status
- migration-up-one:
- goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} up-by-one
- migration-up:
- goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} up
- migration-down-one:
- goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} down
- docker-build:
- docker compose up --build --detach
- docker-up:
- docker compose up --detach
- docker-down:
- docker compose down
- install-deps: install-lint install-goose
- install-lint:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- install-goose:
- go install github.com/pressly/goose/v3/cmd/goose@latest
- app-build:
- env GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o build/app/app cmd/app/main.go
|