Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
benchiverton committed Jul 2, 2024
1 parent d607bea commit 05e59ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/instance-destroy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ jobs:
env:
TF_VAR_acr_username: "not-used"
TF_VAR_acr_password: "not-used"
TF_VAR_website_dns_subdomain: "not-used"
TF_VAR_api_dns_subdomain: "not-used"
TF_VAR_monitoring_dns_subdomain: "not-used"
TF_VAR_website_dns_subdomain: ${{ github.head_ref }}-website
TF_VAR_api_dns_subdomain: ${{ github.head_ref }}-api
TF_VAR_monitoring_dns_subdomain: ${{ github.head_ref }}-monitoring
20 changes: 10 additions & 10 deletions terraform/instance/container_apps_bind_dns/scripts/destroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ die() {
exit 111
}

# get the managed cert using the custom domain
CERTIFICATE_ID=$(
az containerapp env certificate list \
-g $CONTAINER_APP_ENV_RESOURCE_GROUP \
-n $CONTAINER_APP_ENV_NAME \
--managed-certificates-only \
--query "[?properties.subjectName=='$CUSTOM_DOMAIN'].id" \
--output tsv
)

# remove the custom domain from the container app
az containerapp hostname delete --hostname $CUSTOM_DOMAIN \
-g $CONTAINER_APP_RESOURCE_GROUP \
Expand All @@ -41,6 +31,16 @@ if [ "$tries" -ge 12 ]; then
die "waited for 2 minutes, checked the containerapp 12 times and it still has the custom domain. check azure portal..."
fi

# get the managed cert using the custom domain
CERTIFICATE_ID=$(
az containerapp env certificate list \
-g $CONTAINER_APP_ENV_RESOURCE_GROUP \
-n $CONTAINER_APP_ENV_NAME \
--managed-certificates-only \
--query "[?properties.subjectName=='$CUSTOM_DOMAIN'].id" \
--output tsv
)

# destroy the cert
az containerapp env certificate delete \
-g $CONTAINER_APP_ENV_RESOURCE_GROUP \
Expand Down

0 comments on commit 05e59ea

Please sign in to comment.