Skip to content

Commit

Permalink
chore: reuse gallery in windows vhd build (#4283)
Browse files Browse the repository at this point in the history
  • Loading branch information
junjiezhang1997 authored Apr 16, 2024
1 parent 29dd8e3 commit a9fcae8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .pipelines/templates/.builder-release-template-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ steps:
echo "##vso[task.setvariable variable=SIG_FOR_PRODUCTION]False"; \
echo "##vso[task.setvariable variable=SKIPVALIDATEREOFFERUPDATE]True"; \
else
sigImageName="windows-${WINDOWS_SKU}-$RANDOM"; \
sigImageName="windows-${WINDOWS_SKU}-$(date +"%H%M%S")-$RANDOM"; \
WS_SKU=$(echo $WINDOWS_SKU | tr '-' '_')
sigGalleryName="WS${WS_SKU}Gallery$(date +"%y%m%d%H%M%S")$RANDOM"; \
sigGalleryName="WSGallery$(date +"%y%m%d")";\
echo "##vso[task.setvariable variable=SIG_GALLERY_NAME]$sigGalleryName"; \
echo "##vso[task.setvariable variable=SIG_IMAGE_VERSION]1.0.0"; \
echo "##vso[task.setvariable variable=SIG_FOR_PRODUCTION]True"; \
Expand Down
2 changes: 2 additions & 0 deletions vhdbuilder/packer/backfill-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ if [[ -n "${AZURE_RESOURCE_GROUP_NAME}" ]]; then
create_date=${gallery:24:6}
elif [[ "${gallery}" =~ WS2022_containerd_gen2Gallery* ]]; then
create_date=${gallery:29:6}
elif [[ "${gallery}" =~ WSGallery* ]]; then
create_date=${galleries:9:6}
else
continue
fi
Expand Down
4 changes: 0 additions & 4 deletions vhdbuilder/packer/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ if [[ "${MODE}" == "windowsVhdMode" && "$SIG_FOR_PRODUCTION" == "True" ]]; then
echo "Deletion of sig image-definition ${SIG_IMAGE_NAME} completed"
fi
fi

# Delete sig image gallery
echo "SIG_GALLERY_NAME is ${SIG_GALLERY_NAME}, deleting sig gallery since sig is no longer needed"
az sig delete --gallery-name ${SIG_GALLERY_NAME} --resource-group ${AZURE_RESOURCE_GROUP_NAME}
fi
fi

Expand Down

0 comments on commit a9fcae8

Please sign in to comment.