chore: always produce publishing info for windows VHD builds#8256
chore: always produce publishing info for windows VHD builds#8256timmy-wright wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Ensures Windows VHD build pipelines always produce a vhd-publishing-info.json artifact so downstream RP e2e pipelines can automatically consume test-built Windows VHDs.
Changes:
- Removes the
SIG_FOR_PRODUCTION/DRY_RUNgating so the publishing-info generation and artifact publish run for Windows builds. - Moves the “Clean Up Packer Generated Resources” step to run after publishing-info artifact publication.
Comments suppressed due to low confidence (1)
.pipelines/templates/.builder-release-template-windows.yaml:231
- The AzureCLI step that generates the publishing info is missing its list item header (e.g.,
- task: AzureCLI@2). As written,inputs:is directly understeps:which makes the YAML invalid and will prevent the pipeline from parsing/running. Reintroduce the task line (and ensure indentation matches the surrounding- tasksteps).
# Set VHD_NAME and SKU_NAME which will be published.
# Note: use -a to grep OS_DISK_SAS (packer-output should be read as a binary file in Linux)
# we always generate these artifacts - sometimes they are used by downstream pipelines even when
# we are not publishing the image to production.
inputs:
azureSubscription: $(VHD_ARM_SERVICE_CONNECTION)
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
| export captured_sig_version="$(cat vhdbuilder/packer/settings.json | grep "captured_sig_version" | awk -F':' '{print $2}' | awk -F'"' '{print $2}')" | ||
| [ -n "${captured_sig_version}" ] && export VHD_NAME="${captured_sig_version}.vhd"; | ||
| export STORAGE_ACCT_BLOB_URL="$(echo $OS_DISK_SAS | cut -d "/" -f 1-7)"; |
There was a problem hiding this comment.
OS_DISK_SAS is referenced to derive STORAGE_ACCT_BLOB_URL, but it is never set in this script anymore. With the current logic this makes STORAGE_ACCT_BLOB_URL empty (and likely VHD_NAME mismatched for non-production builds), causing generate-vhd-publishing-info.sh to fail because Windows requires STORAGE_ACCT_BLOB_URL and VHD_NAME to be non-empty. Restore the OSDiskUriReadOnlySas extraction from packer-output (or otherwise populate OS_DISK_SAS), and derive both STORAGE_ACCT_BLOB_URL and VHD_NAME consistently from the same source for the non-production path.
| export captured_sig_version="$(cat vhdbuilder/packer/settings.json | grep "captured_sig_version" | awk -F':' '{print $2}' | awk -F'"' '{print $2}')" | |
| [ -n "${captured_sig_version}" ] && export VHD_NAME="${captured_sig_version}.vhd"; | |
| export STORAGE_ACCT_BLOB_URL="$(echo $OS_DISK_SAS | cut -d "/" -f 1-7)"; | |
| export OS_DISK_SAS="$(grep -a 'OSDiskUriReadOnlySas' packer-output | awk -F': ' '{print $2}' | tail -n 1)" | |
| if [[ -z "${OS_DISK_SAS}" ]]; then | |
| echo "OSDiskUriReadOnlySas was not found in packer-output" | |
| exit 1 | |
| fi | |
| export OS_DISK_BLOB_URL="${OS_DISK_SAS%%\?*}" | |
| export VHD_NAME="${OS_DISK_BLOB_URL##*/}" | |
| export STORAGE_ACCT_BLOB_URL="${OS_DISK_BLOB_URL%/*}" |
What this PR does / why we need it:
Currently publishing info files are not created for windows test VHD build pipelines. We need them in order to use these VHDs automatically for rp e2e pipelines.
Sample run: https://msazure.visualstudio.com/CloudNativeCompute/_build/results?buildId=159826599&view=results
Which issue(s) this PR fixes:
Fixes #