-
Notifications
You must be signed in to change notification settings - Fork 136
/
Makefile
45 lines (34 loc) · 1.11 KB
/
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
.PHONY: all
# Go parameters
BINARIES=rport rportd
all: test build
build:
CGO_ENABLED=0 $(foreach BINARY,$(BINARIES),go build -ldflags "-s -w" -o $(BINARY) -v ./cmd/$(BINARY)/...;)
build-debug:
$(foreach BINARY,$(BINARIES),go build -race -gcflags "all=-N -l" -o $(BINARY) -v ./cmd/$(BINARY)/...;)
test:
go test -v ./...
bind-data:
cd db/migration/jobs/sql/ && go-bindata -o ../bindata.go -pkg jobs ./...
cd db/migration/clients/sql/ && go-bindata -o ../bindata.go -pkg clients ./...
cd db/migration/client_groups/sql/ && go-bindata -o ../bindata.go -pkg client_groups ./...
clean:
go clean
rm -f $(BINARIES)
goreleaser-rm-dist:
goreleaser --rm-dist
goreleaser-snapshot:
goreleaser --snapshot --rm-dist
docker-goreleaser:
docker run -it --rm --privileged \
-v ${PWD}:${PWD} \
-v $(shell go env GOCACHE):/cache/go \
-e GOCACHE=/cache/go \
-v /var/run/docker.sock:/var/run/docker.sock \
-w ${PWD} \
goreleaser/goreleaser:latest --snapshot --rm-dist --skip-publish
docker-golangci-lint:
docker run -it --rm \
-v ${PWD}:${PWD} \
-w ${PWD} \
golangci/golangci-lint:v1.32 golangci-lint -c .golangci.yml run