-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (44 loc) · 947 Bytes
/
Makefile
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
bin := loggr
main := cmd/loggr/main.go
gcp_url := us-east5-docker.pkg.dev/loggr-418603/loggr/$(bin)
build:
@go build -o $(bin) $(main)
build.docker:
@docker build -t $(bin) -f ./build/Dockerfile .
build.tag:
@docker tag $(bin) $(gcp_url)
build.push:
@docker push $(gcp_url)
release:
@make lint || exit 1
@make test || exit 1
@make build.docker
@make build.tag
@make build.push
gen:
@go generate ./...
test:
@go test -v ./...
test.cov:
@go test -coverprofile=coverage.out ./...
@go tool cover -html=coverage.out
test.dead:
@deadcode -test ./...
clean:
@rm -f $(bin)
lint:
@make gen
@templ fmt .
@gofumpt -d -w .
@golangci-lint run
dev:
@make gen
@bash -c 'source .env; go run ./cmd/loggr/main.go'
migrate:
@bash -c 'source .env; go run ./cmd/migration/main.go'
done:
@make clean || exit 1
@make test || exit 1
@make lint || exit 1
@make build || exit 1
.PHONY: build gen dev test test.cov test.dead lint clean