зеркало из
1
0
Форкнуть 0
This commit is contained in:
Sushil Kumar 2022-06-15 21:34:44 -07:00 коммит произвёл GitHub
Родитель db9be0d2a3
Коммит 50e792483e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 10 добавлений и 3 удалений

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

@ -64,14 +64,21 @@ if [[ ! -z "$PRE_PROVISIONED_BATCH_ACCOUNT_NAME" ]] && [ "${NO_BATCH_ACCOUNT_POO
BATCH_ACCOUNT_ID=$(az batch account list --query "[?name == '${PRE_PROVISIONED_BATCH_ACCOUNT_NAME}'].id" -o tsv)
BATCH_ACCOUNT_RG_NAME=$(az resource show --ids ${BATCH_ACCOUNT_ID} --query resourceGroup -o tsv)
AZURE_BATCH_ACCESS_KEY=$(az batch account keys list --name ${PRE_PROVISIONED_BATCH_ACCOUNT_NAME} --resource-group ${BATCH_ACCOUNT_RG_NAME} | jq ".primary")
AZURE_BATCH_ENDPOINT=$(az batch account show --name ${PRE_PROVISIONED_BATCH_ACCOUNT_NAME} --resource-group ${BATCH_ACCOUNT_RG_NAME} --query accountEndpoint -o tsv)
set -x
echo "Cleaning the batch job: ${BATCH_ACCOUNT_POOL_NAME}"
az batch job delete --yes \
--job-id ${BATCH_ACCOUNT_POOL_NAME}
--job-id ${BATCH_ACCOUNT_POOL_NAME} \
--account-endpoint ${AZURE_BATCH_ENDPOINT} \
--account-key ${AZURE_BATCH_ACCESS_KEY} \
--account-name ${PRE_PROVISIONED_BATCH_ACCOUNT_NAME}
if [[ $? == 0 ]]; then
echo "Cleanup the batch pool: ${BATCH_ACCOUNT_POOL_NAME}"
az batch pool delete --yes \
--pool-id ${BATCH_ACCOUNT_POOL_NAME}
--pool-id ${BATCH_ACCOUNT_POOL_NAME} \
--account-endpoint ${AZURE_BATCH_ENDPOINT} \
--account-key ${AZURE_BATCH_ACCESS_KEY} \
--account-name ${PRE_PROVISIONED_BATCH_ACCOUNT_NAME}
fi
fi