Skip to content

Commit

Permalink
chore: clean makefile (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
azrod authored Oct 30, 2024
1 parent 7a29893 commit 61cd05f
Show file tree
Hide file tree
Showing 46 changed files with 20 additions and 3,136 deletions.
44 changes: 4 additions & 40 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ help: ## Display this help.
##@ Development

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=manifests/crd
manifests: controller-gen ## Generate CustomResourceDefinition and role manifests.
$(CONTROLLER_GEN) rbac:roleName=kimup-role crd paths="./..." \
output:crd:artifacts:config=manifests/crd \
output:rbac:artifacts:config=manifests/operator

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down Expand Up @@ -87,10 +89,6 @@ build: manifests generate fmt vet ## Build manager binary.
build-kimup: manifests generate fmt vet
go build -o bin/kimup cmd/kimup/*

.PHONY: generate-mutating-config
generate-mutating-config: ## Generate the mutating webhook configuration.
go run ./tools/admission-controller/main.go

.PHONY: run-operator
run-operator: manifests generate fmt vet ## Run a controller from your host.
go run ./cmd/operator/main.go
Expand Down Expand Up @@ -119,40 +117,6 @@ run-kimup: manifests generate fmt vet ## Run the image updater from your host.
run-mkdocs: ## Run mkdocs to serve the documentation locally.
mkdocs serve

# If you wish to build the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .

.PHONY: docker-push
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}

# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=<myregistry/image:<tag>> then the export will fail)
# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name kube-image-updater-builder
$(CONTAINER_TOOL) buildx use kube-image-updater-builder
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
- $(CONTAINER_TOOL) buildx rm kube-image-updater-builder
rm Dockerfile.cross

.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
mkdir -p dist
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default > dist/install.yaml

##@ Deployment

ifndef ignore-not-found
Expand Down
35 changes: 0 additions & 35 deletions config/certmanager/certificate.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions config/certmanager/kustomization.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions config/certmanager/kustomizeconfig.yaml

This file was deleted.

Loading

0 comments on commit 61cd05f

Please sign in to comment.