-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
60 lines (47 loc) · 1.62 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
56
57
58
59
60
# generate mocks
mocks:
mockgen -destination pkg/mocks/lifecycle/mock.go github.com/bakito/batch-job-controller/pkg/lifecycle Controller
mockgen -destination pkg/mocks/logr/mock.go github.com/go-logr/logr Logger
mockgen -destination pkg/mocks/record/mock.go k8s.io/client-go/tools/record EventRecorder
mockgen -destination pkg/mocks/client/mock.go sigs.k8s.io/controller-runtime/pkg/client Client,Reader
mockgen -destination pkg/mocks/manager/mock.go sigs.k8s.io/controller-runtime/pkg/manager Manager
# Run go fmt against code
fmt:
go fmt ./...
gofmt -s -w .
# Run go vet against code
vet:
go vet ./...
# Run go mod tidy
tidy:
go mod tidy
# Run tests
test: tidy mocks fmt vet
go test ./... -coverprofile=coverage.out
go tool cover -func=coverage.out
# Run tests
helm-template: helm
helm template helm/example-batch-job-controller/ --debug --set routes.hostSuffix=test.com
# Build docker image
build-docker:
docker build --build-arg upx_brute=" " -t batch-job-controller .
# Build podman image
build-podman:
podman build --build-arg upx_brute=" " -t batch-job-controller .
release: goreleaser
goreleaser --rm-dist
test-release: goreleaser
goreleaser --skip-publish --snapshot --rm-dist
tools: mockgen ginkgo helm
mockgen:
ifeq (, $(shell which mockgen))
$(shell go get github.com/golang/mock/mockgen)
endif
ginkgo:
ifeq (, $(shell which ginkgo))
$(shell go get github.com/onsi/ginkgo/ginkgo)
endif
helm:
ifeq (, $(shell which helm))
$(shell curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash)
endif