* make uses destroy script

* bug fix

* fix field typo
This commit is contained in:
Tamir Kamara 2022-03-01 08:34:21 +02:00 коммит произвёл GitHub
Родитель 35e04819dc
Коммит 8c6bc851cd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 8 добавлений и 14 удалений

Просмотреть файл

@ -178,9 +178,7 @@ tre-destroy:
&& . ./devops/scripts/check_dependencies.sh nodocker \
&& . ./devops/scripts/load_env.sh ./templates/core/.env \
&& . ./devops/scripts/load_env.sh ./devops/.env \
&& . ./devops/scripts/load_terraform_env.sh ./devops/.env \
&& . ./devops/scripts/load_terraform_env.sh ./templates/core/.env \
&& cd ./templates/core/terraform/ && ./destroy.sh
&& . ./devops/scripts/destroy_env_no_terraform.sh
terraform-deploy:
$(call target_title, "Deploying ${DIR} with Terraform") \

Просмотреть файл

@ -56,11 +56,12 @@ elif [[ "$1" == *"stop"* ]]; then
fi
# Report final FW status
FW_STATE="Stopped"
if [[ $(az network firewall list --query "[?resourceGroup=='rg-${TRE_ID}'&&name=='fw-${TRE_ID}'] | length(@)") != 0 ]]; then
PUBLIC_IP=$(az network firewall ip-config list -f "fw-$TRE_ID" -g "rg-$TRE_ID" --query "[0].publicIpAddress" -o tsv)
if [ -n "$PUBLIC_IP" ]; then
FW_STATE="Running"
else
FW_STATE="Stopped"
fi
fi
# Report final AGW status

Просмотреть файл

@ -23,11 +23,6 @@ USAGE
exit 1
}
# if no arguments are provided, return usage function
if [ $# -eq 0 ]; then
usage # run usage function
fi
no_wait=false
while [ "$1" != "" ]; do
@ -96,7 +91,7 @@ az resource list --resource-group ${core_tre_rg} --query '[].[id]' -o tsv | xarg
# purge keyvault if possible (makes it possible to reuse the same tre_id later)
# this has to be done before we delete the resource group since we don't wait for it to complete
if [[ $(az keyvault list --resource-group ${core_tre_rg} --query '[?proterties.enablePurgeProtection==null] | length (@)') != 0 ]]; then
if [[ $(az keyvault list --resource-group ${core_tre_rg} --query '[?properties.enablePurgeProtection==null] | length (@)') != 0 ]]; then
tre_id=${core_tre_rg#"rg-"}
keyvault_name="kv-${tre_id}"