File tree Expand file tree Collapse file tree
vhdbuilder/prefetch/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ steps:
286286 eq(variables.PREFETCH_COMPATIBLE, 'True')
287287 )
288288 displayName : Run Prefetch Optimization and Convert to VHD blob
289- retryCountOnTaskFailure : 3
289+ retryCountOnTaskFailure : 10
290290 env :
291291 SUBSCRIPTION_ID : $(SUBSCRIPTION_ID)
292292 LOCATION : $(PACKER_BUILD_LOCATION)
Original file line number Diff line number Diff line change @@ -109,8 +109,13 @@ run_image_builder_template() {
109109 echo " image builder template ${IMAGE_BUILDER_TEMPLATE_NAME} has been created, starting run..."
110110 az image builder run -n " ${IMAGE_BUILDER_TEMPLATE_NAME} " -g " ${IMAGE_BUILDER_RG_NAME} "
111111 else
112- echo " will attempt to wait for image builder template ${IMAGE_BUILDER_TEMPLATE_NAME} to finish its last run..."
113- az image builder wait -n " ${IMAGE_BUILDER_TEMPLATE_NAME} " -g " ${IMAGE_BUILDER_RG_NAME} " --custom " lastRunStatus.runState!='Running'"
112+ if [ " $( az image builder show -n " ${IMAGE_BUILDER_TEMPLATE_NAME} " -g " ${IMAGE_BUILDER_RG_NAME} " | jq -r ' .lastRunStatus' ) " = " null" ]; then
113+ echo " template ${IMAGE_BUILDER_TEMPLATE_NAME} has no lastRunStatus, will attempt to run..."
114+ az image builder run -n " ${IMAGE_BUILDER_TEMPLATE_NAME} " -g " ${IMAGE_BUILDER_RG_NAME} "
115+ else
116+ echo " will attempt to wait for image builder template ${IMAGE_BUILDER_TEMPLATE_NAME} to finish its last run..."
117+ az image builder wait -n " ${IMAGE_BUILDER_TEMPLATE_NAME} " -g " ${IMAGE_BUILDER_RG_NAME} " --custom " lastRunStatus.runState!='Running'"
118+ fi
114119 fi
115120
116121 template_run_state=$( az image builder show -n " ${IMAGE_BUILDER_TEMPLATE_NAME} " -g " ${IMAGE_BUILDER_RG_NAME} " | jq -r ' .lastRunStatus.runState' )
You can’t perform that action at this time.
0 commit comments