Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework the Makefile to separate tilt commands #291

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,23 @@ docker-push: .dockerflag.mk ## Push docker image with the manager.
## --------------------------------------

.PHONY: tilt-up
tilt-up: cluster-api kind-cluster cluster-api/tilt-settings.json generate-manifests ## Setup and run tilt for development.
tilt-up: cluster-api create-kind-cluster cluster-api/tilt-settings.json generate-manifests ## Setup and run tilt for development.
cd cluster-api && tilt up

.PHONY: kind-cluster
kind-cluster: cluster-api ## Create a kind cluster with a local Docker repository.
./cluster-api/hack/kind-install-for-capd.sh
KIND_CLUSTER_NAME := $(shell cat ./hack/tilt-settings.json | grep kind_cluster_name | cut -d: -f2 | xargs)

.PHONY: create-kind-cluster
create-kind-cluster: cluster-api cluster-api/tilt-settings.json ## Create a kind cluster with a local Docker repository.
@if [ -z "$$(kind get clusters | grep $(KIND_CLUSTER_NAME))" ]; then \
CAPI_KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) ./cluster-api/hack/kind-install-for-capd.sh; \
fi;

.PHONY: delete-kind-cluster
delete-kind-cluster:
kind delete cluster --name $(KIND_CLUSTER_NAME)

cluster-api: ## Clone cluster-api repository for tilt use.
git clone --branch v1.2.12 --depth 1 https://github.com/kubernetes-sigs/cluster-api.git
git clone --branch v1.3.9 --depth 1 https://github.com/kubernetes-sigs/cluster-api.git

cluster-api/tilt-settings.json: hack/tilt-settings.json cluster-api
cp ./hack/tilt-settings.json cluster-api
Expand Down Expand Up @@ -277,7 +285,7 @@ e2e-cluster-templates: $(CLUSTER_TEMPLATES_OUTPUT_FILES) ## Generate cluster tem
cluster-template%yaml: $(KUSTOMIZE) $(CLUSTER_TEMPLATES_INPUT_FILES)
$(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone $(basename $@) > $@

e2e-essentials: $(GINKGO_V1) $(KUBECTL) e2e-cluster-templates kind-cluster ## Fulfill essential tasks for e2e testing.
e2e-essentials: $(GINKGO_V1) $(KUBECTL) e2e-cluster-templates create-kind-cluster ## Fulfill essential tasks for e2e testing.
IMG=$(IMG_LOCAL) make generate-manifests docker-build docker-push

JOB ?= .*
Expand Down