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

Added command for resource deletion #25

Merged
merged 3 commits into from
Sep 23, 2024
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
13 changes: 9 additions & 4 deletions bicep.makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,17 @@ oc-login: ## Login with oc to existing ARO cluster
-u "$(shell az aro list-credentials --name ${ARO_CLUSTER_NAME} --resource-group ${ARO_RESOURCE_GROUP} --query 'kubeadminUsername' -o tsv)" \
-p "$(shell az aro list-credentials --name ${ARO_CLUSTER_NAME} --resource-group ${ARO_RESOURCE_GROUP} --query 'kubeadminPassword' -o tsv)"

.PHONY: resource-group-delete
resource-group-delete: ## Delete the Azure resource group
.PHONY: aro-resource-group-delete
aro-resource-group-delete: ## Delete the Azure resource group
$(call required-environment-variables,ARO_RESOURCE_GROUP)
az group delete --name ${ARO_RESOURCE_GROUP} --yes --no-wait

.PHONY: aro-delete
aro-delete: ## Delete the ARO cluster
.PHONY: aro-delete-cluster
aro-delete-cluster: ## Delete the ARO cluster
$(call required-environment-variables,ARO_RESOURCE_GROUP ARO_CLUSTER_NAME)
az aro delete --name ${ARO_CLUSTER_NAME} --resource-group ${ARO_RESOURCE_GROUP} --yes --no-wait

.PHONY: aro-delete-resources
aro-delete-resources: ## Delete all resources in the ARO resource group
$(call required-environment-variables,ARO_RESOURCE_GROUP)
az resource delete --resource-group ${ARO_RESOURCE_GROUP} --ids $$(az resource list --resource-group ${ARO_RESOURCE_GROUP} --query "[].id" -o tsv)