Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. include config/.env
  2. GOOSE_DB_STRING = ${DB_USER}:${DB_PASSWORD}@/${DB_NAME}?parseTime=true
  3. usage:
  4. @echo "make run"
  5. @echo "make app-build"
  6. @echo "make lint"
  7. @echo "make test"
  8. @echo "make test-cover"
  9. @echo "make docker-build"
  10. @echo "make docker-up"
  11. @echo "make docker-down"
  12. @echo "make migration-status"
  13. @echo "make migration-up"
  14. run:
  15. cd cmd/app && go run main.go
  16. app-build:
  17. env GOOS=linux GOARCH=amd64 go build -o build/app/app cmd/app/main.go
  18. lint:
  19. golangci-lint run --timeout=3m
  20. test:
  21. go test ./...
  22. test-cover:
  23. go test ./... -coverprofile=build/coverage.out
  24. go tool cover -html=build/coverage.out
  25. docker-build:
  26. docker compose --file build/docker/docker-compose.yml --env-file config/.env --project-name dmitriygnatenko up --build --detach
  27. docker-up:
  28. docker compose --file build/docker/docker-compose.yml --env-file config/.env --project-name dmitriygnatenko up --detach
  29. docker-down:
  30. docker compose --file build/docker/docker-compose.yml --env-file config/.env --project-name dmitriygnatenko down
  31. migration-status:
  32. goose -dir migrations mysql ${GOOSE_DB_STRING} status
  33. migration-up:
  34. goose -dir migrations mysql ${GOOSE_DB_STRING} up