@@ -52,29 +52,23 @@ ${CACHE}/imagepolicies_${REFLECTOR_VER}.yaml:
5252 curl -s --fail https://raw.githubusercontent.com/fluxcd/image-reflector-controller/${REFLECTOR_VER} /config/crd/bases/image.toolkit.fluxcd.io_imagepolicies.yaml \
5353 -o ${CACHE} /imagepolicies_${REFLECTOR_VER} .yaml
5454
55- # Run tests
56- test : test_deps generate fmt vet manifests api-docs
55+ test : test_deps generate fmt vet manifests api-docs # # Run tests
5756 go test ./... -coverprofile cover.out
5857 cd api; go test ./... -coverprofile cover.out
5958
60- # Build manager binary
61- manager : generate fmt vet
59+ manager : generate fmt vet # # Build manager binary
6260 go build -o bin/manager main.go
6361
64- # Run against the configured Kubernetes cluster in ~/.kube/config
65- run : generate fmt vet manifests
62+ run : generate fmt vet manifests # Run against the configured Kubernetes cluster in ~/.kube/config
6663 go run ./main.go --log-level=${LOG_LEVEL} --log-encoding=console
6764
68- # Install CRDs into a cluster
69- install : manifests
65+ install : manifests # # Install CRDs into a cluster
7066 kustomize build config/crd | kubectl apply -f -
7167
72- # Uninstall CRDs from a cluster
73- uninstall : manifests
68+ uninstall : manifests # # Uninstall CRDs from a cluster
7469 kustomize build config/crd | kubectl delete -f -
7570
76- # Deploy controller in the configured Kubernetes cluster in ~/.kube/config
77- deploy : manifests
71+ deploy : manifests # # Deploy controller in the configured Kubernetes cluster in ~/.kube/config
7872 cd config/manager && kustomize edit set image fluxcd/image-automation-controller=${IMG}
7973 kustomize build config/default | kubectl apply -f -
8074
@@ -84,48 +78,38 @@ dev-deploy: manifests
8478 kustomize build config/dev | kubectl apply -f -
8579 rm -rf config/dev
8680
87- # Generate manifests e.g. CRD, RBAC etc.
88- manifests : controller-gen
81+ manifests : controller-gen # # Generate manifests e.g. CRD, RBAC etc.
8982 cd api; $(CONTROLLER_GEN ) $(CRD_OPTIONS ) rbac:roleName=manager-role paths=" ./..." output:crd:artifacts:config=" ../config/crd/bases"
9083
91- # Generate API reference documentation
92- api-docs : gen-crd-api-reference-docs
84+ api-docs : gen-crd-api-reference-docs # # Generate API reference documentation
9385 $(API_REF_GEN ) -api-dir=./api/v1beta1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/image-automation.md
9486
95- # Run go mod tidy
96- tidy :
87+ tidy : # # Run go mod tidy
9788 cd api; rm -f go.sum; go mod tidy
9889 rm -f go.sum; go mod tidy
9990
100- # Run go fmt against code
101- fmt :
91+ fmt : # # Run go fmt against code
10292 go fmt ./...
10393 cd api; go fmt ./...
10494
105- # Run go vet against code
106- vet :
95+ vet : # # Run go vet against code
10796 go vet ./...
10897 cd api; go vet ./...
10998
110- # Generate code
111- generate : controller-gen
99+
100+ generate : controller-gen # # Generate code
112101 cd api; $(CONTROLLER_GEN ) object:headerFile=" ../hack/boilerplate.go.txt" paths=" ./..."
113102
114- # Build the docker image
115- docker-build : test
103+ docker-build : test # # Build the Docker image
116104 docker build . -t ${IMG}
117105
118- # Push the docker image
119- docker-push :
106+ docker-push : # # Push the Docker image
120107 docker push ${IMG}
121108
122- # Set the docker image in-cluster
123- docker-deploy :
109+ docker-deploy : # # Set the Docker image in-cluster
124110 kubectl -n flux-system set image deployment/image-automation-controller manager=${IMG}
125111
126- # find or download controller-gen
127- # download controller-gen if necessary
128- controller-gen :
112+ controller-gen : # # Find or download controller-gen
129113ifeq (, $(shell which controller-gen) )
130114 @{ \
131115 set -e ;\
140124CONTROLLER_GEN =$(shell which controller-gen)
141125endif
142126
143- # Find or download gen-crd-api-reference-docs
144- gen-crd-api-reference-docs :
127+ gen-crd-api-reference-docs : # # Find or download gen-crd-api-reference-docs
145128ifeq (, $(shell which gen-crd-api-reference-docs) )
146129 @{ \
147130 set -e ;\
@@ -155,3 +138,7 @@ API_REF_GEN=$(GOBIN)/gen-crd-api-reference-docs
155138else
156139API_REF_GEN =$(shell which gen-crd-api-reference-docs)
157140endif
141+
142+ .PHONY : help
143+ help : # # Display this help menu
144+ @awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
0 commit comments