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 resource deletion commands #24

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
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
15 changes: 10 additions & 5 deletions bicep.makefile
kksat marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ ARO_CLUSTER_NAME?=aro-sapeic
ARO_DOMAIN?=saponrhel.org
ARO_VERSION?=4.14.16

.PHONY: aro-remove
aro-remove: ## Remove ARO
$(call required-environment-variables,ARO_RESOURCE_GROUP)
az deployment group create --resource-group ${ARO_RESOURCE_GROUP} --template-file bicep/empty.bicep --mode Complete

.PHONY: aro-deploy
aro-deploy: domain-zone-exists network-deploy ## Deploy ARO
$(call required-environment-variables,ARO_RESOURCE_GROUP ARO_CLUSTER_NAME ARO_DOMAIN ARO_VERSION CLIENT_ID CLIENT_SECRET)
Expand Down Expand Up @@ -81,3 +76,13 @@ oc-login: ## Login with oc to existing ARO cluster
oc login "$(shell az aro show --name ${ARO_CLUSTER_NAME} --resource-group ${ARO_RESOURCE_GROUP} --query "apiserverProfile.url" -o tsv)" \
-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
$(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
$(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
Empty file removed bicep/empty.bicep
Empty file.