2022-05-07 16:37:21 +00:00
|
|
|
BREW_PREFIX ?= $(shell brew --prefix)
|
|
|
|
DATABASE_URL ?= "postgres://$(USER)@localhost/apollo_test?sslmode=disable"
|
2023-04-01 15:57:28 +00:00
|
|
|
REDIS_URL ?= "redis://localhost:6379"
|
2022-05-07 16:37:21 +00:00
|
|
|
|
|
|
|
test:
|
2023-04-01 15:57:28 +00:00
|
|
|
@DATABASE_URL=$(DATABASE_URL) REDIS_URL=$(REDIS_URL) go test -race -timeout 1s ./...
|
2022-05-07 16:37:21 +00:00
|
|
|
|
|
|
|
test-setup: $(BREW_PREFIX)/bin/migrate
|
|
|
|
migrate -path migrations/ -database $(DATABASE_URL) up
|
|
|
|
|
|
|
|
build:
|
|
|
|
@go build ./cmd/apollo
|
|
|
|
|
|
|
|
lint:
|
|
|
|
@golangci-lint run
|
|
|
|
|
|
|
|
$(BREW_PREFIX)/bin/migrate:
|
|
|
|
@brew install golang-migrate
|
|
|
|
|
|
|
|
.PHONY: all build deps lint test
|