-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
54 lines (42 loc) · 1.01 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
BUILD_TARGET=./
ORG=integreatly
REG=quay.io
PROJECT=cluster-service
TAG=0.4.0
CLUSTER_SERVICE_IMAGE ?= $(REG)/$(ORG)/$(PROJECT):v$(TAG)
.PHONY: image/build/
image/build: build/cli
@docker build -t $(CLUSTER_SERVICE_IMAGE) .
.PHONY: image/push
image/push:
docker push $(CLUSTER_SERVICE_IMAGE)
.PHONY: image/build/push
image/build/push: image/build image/push
.PHONY: build/cli
build/cli: build/cli/local
mv ./cli ./cluster-service
.PHONY: build/cli/local
build/cli/local:
go build -o=$(BUILD_TARGET) ./cmd/cli
.PHONY: code/fix
code/fix:
@gofmt -w `find . -type f -name '*.go' -not -path "./vendor/*"`
.PHONY: code/check
code/check:
go vet ./...
.PHONY: code/gen
code/gen:
go generate ./...
.PHONY: test/unit
test/unit:
go test -v -covermode=count ./...
.PHONY: vendor/check
vendor/check: vendor/fix
git diff --exit-code vendor/
.PHONY: vendor/fix
vendor/fix:
go mod tidy
go mod vendor
.PHONY: setup/goreleaser
setup/goreleaser:
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh