blob: 9af2f76e4fc61672536610319fab9fd474e5c077 (
plain)
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
|
current_dir = $(shell pwd)
version = $(shell printf '%s' $$(cat VERSION))
.PHONEY: lint
lint:
golangci-lint run ./...
.PHONEY: build
build:
go build -o gomodguard cmd/gomodguard/main.go
.PHONEY: dockerbuild
dockerbuild:
docker build --build-arg GOMODGUARD_VERSION=${version} --tag ryancurrah/gomodguard:${version} .
.PHONEY: run
run: build
./gomodguard
.PHONEY: test
test:
go test -v -coverprofile coverage.out
.PHONEY: cover
cover:
gocover-cobertura < coverage.out > coverage.xml
.PHONEY: dockerrun
dockerrun: dockerbuild
docker run -v "${current_dir}/.gomodguard.yaml:/.gomodguard.yaml" ryancurrah/gomodguard:latest
.PHONEY: release
release:
git tag ${version}
git push --tags
goreleaser --skip-validate --rm-dist
.PHONEY: clean
clean:
rm -rf dist/
rm -f gomodguard coverage.xml coverage.out
.PHONEY: install-tools-mac
install-tools-mac:
brew install goreleaser/tap/goreleaser
.PHONEY: install-go-tools
install-go-tools:
go get github.com/t-yuki/gocover-cobertura
|