@@ -20,10 +20,29 @@ SHELL := /bin/bash
2020
2121# Cortex
2222
23+ # build cli, start local operator, and watch for changes
2324devstart :
2425 @$(MAKE ) operator-stop || true
2526 @./dev/operator_local.sh || true
2627
28+ .PHONY : cli
29+ cli :
30+ @mkdir -p ./bin
31+ @go build -o ./bin/cortex ./cli
32+
33+ # build cli and watch for changes
34+ cli-watch :
35+ @clear && echo " building cli..."
36+ @$(MAKE ) cli
37+ @clear && echo -e " \033[1;32mCLI built\033[0m"
38+ @watchmedo shell-command --command=' clear && echo "rebuilding cli..." && go build -o ./bin/cortex ./cli && clear && echo "\033[1;32mCLI built\033[0m"' --patterns ' *.go;*.yaml' --recursive --drop ./pkg ./cli
39+
40+ # start local operator and watch for changes
41+ operator-local :
42+ @$(MAKE ) operator-stop || true
43+ @./dev/operator_local.sh --operator-only || true
44+
45+ # configure kubectl to point to the cluster specified in dev/config/cluster.yaml
2746kubectl :
2847 @eval $$(python3 ./manager/cluster_config_env.py ./dev/config/cluster.yaml ) && eksctl utils write-kubeconfig --cluster=" $$ CORTEX_CLUSTER_NAME" --region=" $$ CORTEX_REGION" | grep -v " saved kubeconfig as" | grep -v " using region" | grep -v " eksctl version" || true
2948
@@ -70,6 +89,7 @@ cluster-configure-y:
7089 @kill $(shell pgrep -f make) > /dev/null 2>&1 || true
7190 @./bin/cortex -c=./dev/config/cluster.yaml cluster configure --yes
7291
92+ # stop the in-cluster operator
7393operator-stop :
7494 @$(MAKE ) kubectl
7595 @kubectl delete --namespace=default --ignore-not-found=true deployment operator
@@ -120,17 +140,6 @@ manager-local:
120140
121141# Misc
122142
123- .PHONY : cli
124- cli :
125- @mkdir -p ./bin
126- @go build -o ./bin/cortex ./cli
127-
128- cli-watch :
129- @clear && echo " building cli..."
130- @$(MAKE ) cli
131- @clear && echo -e " \033[1;32mCLI built\033[0m"
132- @watchmedo shell-command --command=' clear && echo "rebuilding cli..." && go build -o ./bin/cortex ./cli && clear && echo "\033[1;32mCLI built\033[0m"' --patterns ' *.go;*.yaml' --recursive --drop ./pkg ./cli
133-
134143aws-clear-bucket :
135144 @./dev/aws.sh clear-bucket
136145
0 commit comments