forked from create-go-app/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (31 loc) · 1.15 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
.PHONY: clean security critic test install build release build-and-push-images delete-tag update-pkg-cache
clean:
rm -rf ./tmp ./tests
security:
go run github.com/securego/gosec/v2/cmd/gosec@latest -quiet ./...
critic:
go run github.com/go-critic/go-critic/cmd/gocritic@latest check -enableAll ./...
test: clean security critic
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/cgapp ./cmd/cgapp/main.go
build: test
goreleaser --snapshot
release: test
git tag -a v$(VERSION) -m "$(VERSION)"
goreleaser --snapshot
build-and-push-images: test
docker build -t docker.io/koddr/cgapp:latest .
docker push docker.io/koddr/cgapp:latest
docker build -t docker.io/koddr/cgapp:$(VERSION) .
docker push docker.io/koddr/cgapp:$(VERSION)
docker image rm docker.io/koddr/cgapp:$(VERSION)
update-pkg-cache:
curl -i https://proxy.golang.org/github.com/create-go-app/cli/v4/@v/v$(VERSION).info
delete-tag:
git tag --delete v$(VERSION)
docker image rm docker.io/koddr/cgapp:latest
docker image rm docker.io/koddr/cgapp:$(VERSION)