test: make test more resilient
During manual cleanup of unused resources, the storage account can get removed. The current storage account is not possible to remove mannually, but adding this check to make it more resielient in future scenarios.
This commit is contained in:
parent
f284e2a932
commit
786fc2719d
1 changed files with 11 additions and 0 deletions
|
|
@ -178,6 +178,17 @@ name = "cloud-init"
|
|||
enabled = ["sshd", "cloud-init", "cloud-init-local", "cloud-config", "cloud-final"]
|
||||
EOF
|
||||
|
||||
# Make sure the specified storage account exists
|
||||
if [ "$(az resource list --name "$AZURE_STORAGE_ACCOUNT")" == "[]" ]; then
|
||||
echo "The storage account ${AZURE_STORAGE_ACCOUNT} was removed!"
|
||||
az storage account create \
|
||||
--name "${AZURE_STORAGE_ACCOUNT}" \
|
||||
--resource-group "${AZURE_RESOURCE_GROUP}" \
|
||||
--location "${AZURE_LOCATION}" \
|
||||
--sku Standard_RAGRS \
|
||||
--kind StorageV2
|
||||
fi
|
||||
|
||||
# Prepare the blueprint for the compose.
|
||||
greenprint "📋 Preparing blueprint"
|
||||
sudo composer-cli blueprints push "$BLUEPRINT_FILE"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue