This repository was archived by the owner on Apr 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-18
lines changed
Expand file tree Collapse file tree 2 files changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -203,23 +203,6 @@ function storage_account_table_exists () {
203203 if [ " $action " == " delete" ]; then
204204 echo " Delete table '$t '"
205205 az storage table delete -n $t --account-name $sa_name
206- total_wait_seconds=20
207- wait_delete_seconds=50
208- start=0
209- wait_seconds=5
210- while [ $start -lt $total_wait_seconds ]; do
211- sat_result=$( az storage table exists -n $t --account-name $sa_name )
212- sat_exists=$( echo $sat_result | jq ' .exists | . == true' )
213- if [ " $sat_exists " = " false" ]; then
214- echo " The table '$t ' was marked deleted"
215- echo " Wait $wait_delete_seconds seconds for delete..."
216- sleep $wait_delete_seconds
217- break
218- fi
219- echo " Wait $wait_seconds seconds..."
220- sleep $wait_seconds
221- start=$(( start + wait_seconds))
222- done
223206 fi
224207 else
225208 echo " Check if $t exists"
Original file line number Diff line number Diff line change @@ -68,7 +68,23 @@ sat_onboard_name=smokedeploymentstest
6868subscription_id=$( az account list | jq ' .[] | select(.isDefault == true) | .id' -r)
6969storage_account_exists $AZ_STORAGE_ACCOUNT $AZ_RESOURCE_GROUP " fail"
7070storage_account_table_exists $sat_onboard_name $AZ_STORAGE_ACCOUNT " delete"
71- spk deployment onboard -s $AZ_STORAGE_ACCOUNT -t $sat_onboard_name -l $sa_location -r $AZ_RESOURCE_GROUP --subscription-id $subscription_id --service-principal-id $SP_APP_ID --service-principal-password $SP_PASS --tenant-id $SP_TENANT
71+
72+ wait_delete_seconds=50
73+ start=0
74+ wait_seconds=5
75+ while [ $start -lt $wait_delete_seconds ]; do
76+ onboard_result=$( spk deployment onboard -s $AZ_STORAGE_ACCOUNT -t $sat_onboard_name -l $sa_location -r $AZ_RESOURCE_GROUP --subscription-id $subscription_id --service-principal-id $SP_APP_ID --service-principal-password $SP_PASS --tenant-id $SP_TENANT )
77+ if [[ $onboard_result == * " table is being deleted" * ]]; then
78+ echo " Table $sat_onboard_name is still being deleted"
79+ echo " Wait $wait_seconds seconds..."
80+ sleep $wait_seconds
81+ start=$(( start + wait_seconds))
82+ else
83+ echo " onboard finished"
84+ break
85+ fi
86+ done
87+
7288storage_account_table_exists $sat_onboard_name $AZ_STORAGE_ACCOUNT " fail"
7389storage_account_table_exists $sat_onboard_name $AZ_STORAGE_ACCOUNT " delete"
7490
You can’t perform that action at this time.
0 commit comments