-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (59 loc) · 2.13 KB
/
Makefile
File metadata and controls
85 lines (59 loc) · 2.13 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
DATABASE=chat-roulette
MIGRATIONS_DIR=internal/database/migrations
MIGRATIONS_SOURCE ?= file iofs
go/install:
go get -v
go/tools:
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6
go install -tags 'postgres $(MIGRATIONS_SOURCE)' github.com/golang-migrate/migrate/v4/cmd/migrate@v4.18.3
go install gotest.tools/gotestsum@v1.12.3
go install github.com/miniscruff/changie@v1.22.0
go/tidy:
go mod tidy -compat=1.23
go/test:
go test -v --cover ./...
go/testsum:
gotestsum --format testname --no-color=false -- --cover ./...
go/lint:
golangci-lint run --allow-parallel-runners
go/lint/output-html:
golangci-lint run --allow-parallel-runners > .lint-report.html
go/run:
./scripts/go.sh run
go/build:
./scripts/go.sh build
go/coverage:
go tool cover -html=.coverage.out
go/clean:
go clean -modcache
rm -rf .coverage.out bin/
generate/key:
openssl rand -hex 32
docker/build/app-manifest:
docker buildx build --platform=linux/amd64 -t ghcr.io/chat-roulettte/app-manifest:latest -f cmd/app-manifest/Dockerfile .
docker/build/chat-roulette:
docker buildx build --platform=linux/amd64 -t ghcr.io/chat-roulettte/chat-roulette:latest -f cmd/chat-roulette/Dockerfile .
docker/push/app-manifest:
docker push ghcr.io/chat-roulettte/app-manifest:latest
db/run:
docker run -d -p 5432:5432 --name postgres -e POSTGRES_DB=$(DATABASE) -e POSTGRES_PASSWORD=letmein docker.io/library/postgres:14.5
db/stop:
docker rm -f postgres
migrate/create:
@read -p "Enter migration filename: " FILENAME; \
migrate create -ext sql -dir $(MIGRATIONS_DIR) $$FILENAME
migrate/up:
migrate -database 'postgres://postgres:letmein@localhost:5432/$(DATABASE)?sslmode=disable' -path $(MIGRATIONS_DIR) up
migrate/down:
migrate -database 'postgres://postgres:letmein@localhost:5432/$(DATABASE)?sslmode=disable' -path $(MIGRATIONS_DIR) down
migrate/force:
@read -p "Enter force version: " VERSION; \
migrate -database 'postgres://postgres:letmein@localhost:5432/$(DATABASE)?sslmode=disable' -path $(MIGRATIONS_DIR) force $$VERSION
ngrok:
ngrok http 8080
dev/up:
./scripts/dev.sh up
dev/destroy:
./scripts/dev.sh destroy
generate/changelog:
changie merge