Skip to content

Commit

Permalink
ops: Added upload resource billing developer index.html (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuraf authored Nov 18, 2024
1 parent 46c4330 commit 00514c4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions infra/apim_v2/developer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,30 @@ resource "null_resource" "upload_internal_developer_index_v1" {
}
}

resource "null_resource" "upload_billing_developer_index_v1" {
triggers = {
file_sha1 = filesha1("./env/${var.env}/developer/billing-portal/v1/index.html")
}

provisioner "local-exec" {
command = <<EOT
az storage blob upload \
--container '$web' \
--account-name ${replace(replace(local.checkout_cdn_name, "-cdn-endpoint", "-sa"), "-", "")} \
--account-key ${data.azurerm_storage_account.checkout.primary_access_key} \
--file "./env/${var.env}/developer/billing-portal/v1/index.html" \
--overwrite true \
--name 'developer/billing-portal/v1/index.html' &&
az cdn endpoint purge \
--resource-group ${data.azurerm_storage_account.checkout.resource_group_name} \
--name ${local.checkout_cdn_name} \
--profile-name ${replace(local.checkout_cdn_name, "-cdn-endpoint", "-cdn-profile")} \
--content-paths "/developer/billing-portal/v1/index.html" \
--no-wait
EOT
}
}

resource "null_resource" "upload_support_pnpg_developer_index_v1" {
triggers = {
file_sha1 = filesha1("./env/${var.env}/developer/support-pnpg/v1/index.html")
Expand Down

0 comments on commit 00514c4

Please sign in to comment.