.PHONY: preview
preview:
	@echo "e.g.: BUILD_PATH=gke-provider/base make preview"
	@echo "building $(BUILD_PATH)..."

	kustomize build  "$(BUILD_PATH)"

.PHONY: sync-infra-api-crd
sync-infra-api-crd:
	cd ./infra-api-crd && ./sync-crd.sh $(branch) $(stage)

sync-infra-api-webhook:
	cd ./infra-api-webhook && ./sync-webhook.sh $(branch) $(stage)
	cd ./infra-api-webhook && ./patch-webhook.py --env $(stage) --ca "$(or , $(ca_bundle))"

.PHONY: bump-tidb-operator
# usage: DEPLOY_ENV=stg OLD_VERSION=v1.6.0-alpha.13 NEW_VERSION=v1.6.0-alpha.14 make bump-tidb-operator
bump-tidb-operator:
	./hack/bump-tidb-operator.sh

.PHONY: bump-cluster-agent
# usage: DEPLOY_ENV=stg NEW_VERSION=v0.1.0 make bump-cluster-agent
bump-cluster-agent:
	./hack/bump-cluster-agent.sh

.PHONY: bump-cluster-proxy
# usage: DEPLOY_ENV=stg NEW_VERSION=v0.1.0 make bump-cluster-proxy
bump-cluster-proxy:
	./hack/bump-cluster-proxy.sh
