-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
61 lines (46 loc) · 2.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
55
56
57
58
59
60
# Include toolbox tasks
include ./.toolbox.mk
# generate mocks
mocks: tb.mockgen
$(TB_MOCKGEN) -destination pkg/mocks/lifecycle/mock.go github.com/bakito/batch-job-controller/pkg/lifecycle Controller
$(TB_MOCKGEN) -destination pkg/mocks/logr/mock.go github.com/go-logr/logr LogSink
$(TB_MOCKGEN) -destination pkg/mocks/record/mock.go k8s.io/client-go/tools/record EventRecorder
$(TB_MOCKGEN) -destination pkg/mocks/client/mock.go sigs.k8s.io/controller-runtime/pkg/client Client,Reader
$(TB_MOCKGEN) -destination pkg/mocks/manager/mock.go sigs.k8s.io/controller-runtime/pkg/manager Manager
# Run go mod tidy
tidy:
go mod tidy
# Run tests
test: tb.ginkgo tidy mocks
$(TB_GINKGO) --cover -r -output-dir=. -coverprofile=coverage.out
lint: golangci-lint
$(TB_GOLANGCI_LINT) run --fix
# Run tests
helm-lint: helm
helm lint helm/example-batch-job-controller/ --set routes.hostSuffix=test.com --strict
helm-template: helm-lint
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: tb.semver tb.goreleaser
@version=$$($(TB_SEMVER)); \
git tag -s $$version -m"Release $$version"
$(TB_GORELEASER) --clean
test-release: tb.goreleaser
$(TB_GORELEASER) --skip=publish --snapshot --clean
tools: tb.mockgen tb.ginkgo helm
helm:
ifeq (, $(shell which helm))
$(shell curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash)
endif
docs: tb.helm-docs update-docs
@$(TB_HELM_DOCS)
update-docs: tb.semver
@version=$$($(TB_SEMVER) -next); \
versionNum=$$($(TB_SEMVER) -next -numeric); \
sed -i "s/^version:.*$$/version: $${versionNum}/" ./helm/example-batch-job-controller/Chart.yaml; \
sed -i "s/^appVersion:.*$$/appVersion: $${version}/" ./helm/example-batch-job-controller/Chart.yaml