Skip to content

Commit

Permalink
Rework the Makefile to separate tilt commands
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdoherty4 committed Jul 14, 2023
1 parent 4ccf853 commit 2385851
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 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

0 comments on commit 2385851

Please sign in to comment.