forked from TheEdgeOfRage/ytrssil
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (39 loc) · 1.34 KB
/
Makefile
File metadata and controls
50 lines (39 loc) · 1.34 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
.PHONY: all lint test air templ build gen-mocks migrate image-build
DB_URI ?= postgres://ytrssil:ytrssil@localhost:5432/ytrssil?sslmode=disable
bin:
mkdir bin
bin/moq: bin
GOBIN=$(PWD)/bin go install github.com/matryer/moq@v0.7.1
bin/golangci-lint: bin
GOBIN=$(PWD)/bin go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.4
bin/migrate: bin
GOBIN=$(PWD)/bin go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@v4.19.1
bin/air: bin
GOBIN=$(PWD)/bin go install github.com/air-verse/air@v1.64.5
bin/templ: bin
GOBIN=$(PWD)/bin go install github.com/a-h/templ/cmd/templ@v0.3.1001
fmt:
go mod tidy
bin/golangci-lint fmt
lint: bin/golangci-lint
go mod tidy -diff
go vet ./...
bin/golangci-lint run
bin/golangci-lint fmt -d
test:
go test -timeout=30s -race ./...
air: bin/air
@./bin/air -c .air.toml
templ: bin/templ
bin/templ generate
build: templ
go build -o dist/ytrssil ./cmd/main.go
gen-mocks: bin/moq
./bin/moq -pkg db_mock -out ./mocks/db/db.go ./db DB
./bin/moq -pkg parser_mock -out ./mocks/feedparser/feedparser.go ./feedparser Parser
./bin/moq -pkg youtube_mock -out ./mocks/youtube/youtube.go ./lib/clients/youtube Client
go fmt ./...
migrate: bin/migrate
bin/migrate -database "$(DB_URI)" -path migrations up
image-build:
docker buildx build --push -t theedgeofrage/ytrssil:api --target api .