-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (31 loc) · 1.13 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
.PHONY: clean lint security critic test install build release build-and-push-images delete-tag update-pkg-cache
clean:
rm -rf build
lint:
$(GOPATH)/bin/golangci-lint run --timeout 5m ./..
security:
$(GOPATH)/bin/gosec ./..
critic:
$(GOPATH)/bin/gocritic check -enableAll ./...
test: clean init security critics
mkdir ./tests
go test -coverprofile=./tests/coverage.out ./...
go tool cover -func=./tests/coverage.out
rm -rf ./tests
install: test
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(GOPATH)/bin/wetlog ./main.go
build: test
$(GOPATH)/bin/goreleaser --snapshot --skip-publish --rm-dist
release: test
git tag -a v$(VERSION) -m "$(VERSION)"
$(GOPATH)/bin/goreleaser --snapshot --skip-publish --rm-dist
build-and-push-images: test
docker build -t docker.io/kenjords/wetlog:latest .
docker push docker.io/kenjords/wetlog:latest
docker build -t docker.io/kenjords/wetlog:$(VERSION) .
docker push docker.io/kenjords/wetlog:$(VERSION)
docker image rm docker.io/kenjords/wetlog:$(VERSION)
delete-tag:
git tag --delete v$(VERSION)
docker image rm docker.io/kenjords/wetlog:latest
docker image rm docker.io/kenjords/wetlog:$(VERSION)