-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (29 loc) · 834 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
SHELL := /bin/bash
# The name of the executable
TARGET := 'query-sniper'
# Use linker flags to provide version/build settings to the target.
LDFLAGS=-ldflags "-s -w"
all: clean lint build
$(TARGET):
@go build $(LDFLAGS) -o $(TARGET) cmd/query-sniper/main.go
build: clean $(TARGET)
@true
clean:
@rm -rf $(TARGET) *.test *.out tmp/* coverage dist
lint:
@gofumpt -l -w .
@go vet ./...
@golangci-lint run --config=.golangci.yml --allow-parallel-runners
tests:
@mkdir -p coverage
@go test ./... -v -shuffle=on -coverprofile coverage/coverage.out
coverage: test
@go tool cover -html=coverage/coverage.out
run: build
@./$(TARGET)
docker: clean lint
@docker build -f build/dev.Dockerfile . -t persona-id/query-sniper:latest
snapshot: clean lint
@goreleaser --snapshot --clean
release: clean lint
@goreleaser --clean