-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (42 loc) · 1.07 KB
/
Makefile
File metadata and controls
55 lines (42 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
MIGRATIONS_PATH=migrations
E2E_MIGRATIONS_PATH=e2e/migrations
POSTGRES_STRING=postgresql://user:password@localhost:5432/chattery?sslmode=disable
DOCKER_COMPOSE_BIN=docker-compose
.PHONY: run
run:
go tool air -c .air.toml
.PHONY: run-web
run-web:
cd web && npm run dev
.PHONY: build
build:
go build -o ./bin/chattery ./cmd/main.go
.PHONY: build-web
build-web:
cd web && npm run build
.PHONY: down
down:
$(DOCKER_COMPOSE_BIN) down -v
.PHONY: up
up: up-docker up-migrate up-e2e
.PHONY: up-docker
up-docker:
$(DOCKER_COMPOSE_BIN) up -d
.PHONY: up-migrate
up-migrate:
GOOSE_DRIVER=postgres GOOSE_DBSTRING='$(POSTGRES_STRING)' goose -dir '$(MIGRATIONS_PATH)' up
.PHONY: up-e2e
up-e2e:
GOOSE_DRIVER=postgres GOOSE_DBSTRING='$(POSTGRES_STRING)' goose -dir '$(E2E_MIGRATIONS_PATH)' up
.PHONY: generate-sqlc
generate-sqlc:
go tool sqlc generate
.PHONY: lint
lint: install-golangci
./bin/golangci-lint run ./...
.PHONY: test
test:
go test ./...
.PHONY: install-golangci
install-golangci:
GOBIN=$(PWD)/bin go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.4