-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathMakefile
55 lines (44 loc) · 1.16 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
46
47
48
49
50
51
52
53
54
55
GO ?= go
GOFLAGS := -v
PKG := ./...
TESTS := ".*"
GOIMPORTS := goimports
VERSION ?= $(shell git describe --long --tags --always)
.PHONY: build
$(GO) install $(GOVERSIONLDFLAG) $(GOFLAGS)
.PHONY: test
test:
$(GO) test $(GOFLAGS) $(PKG)
.PHONY: generate
generate:
go generate ./...
.PHONY: check
check:
$(GO) vet --all . 2>&1
.PHONY: fmt
fmt:
gofmt -s -w .
$(GOIMPORTS) -w .
.PHONY: clean
clean:
rm -f $(GOPATH)/bin/$(PROGNAME)
$(GO) clean $(GOFLAGS) -i $(PKG)
.PHONY: goreleaser-test
goreleaser-test:
git tag ${VERSION}
docker run --rm \
-v $(shell pwd):/go/src/github.com/dcoker/biscuit \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/dcoker/biscuit \
-e GITHUB_TOKEN=${GITHUB_TOKEN} \
goreleaser/goreleaser release --rm-dist --snapshot
.PHONY: localstack
localstack:
docker network create localstack
docker run --name localstack --network localstack --rm -d -p 4566:4566 -p 4571:4571 localstack/localstack:0.12.17.5
.PHONY: docker
docker:
docker build -t ghcr.io/dcoker/biscuit .
.PHONY: lint
lint:
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:latest golangci-lint run --config .github/golangci.yml -v