Skip to content

Commit 38b55d4

Browse files
authored
Merge pull request #129 from cloudfoundry/use-azure-vhd-filename
Use filename when referencing blob, not signed url
2 parents e9a391b + ace1c65 commit 38b55d4

File tree

2 files changed

+6
-6
lines changed
  • ci
    • pipelines
    • tasks/azure-image-upload-and-start-publishing

2 files changed

+6
-6
lines changed

ci/pipelines/vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AWS_GOVCLOUD_PACKER_REGION: us-gov-west-1
1212
# Azure
1313
AZURE_BASE_IMAGE: 2019-Datacenter-Core-smalldisk
1414
AZURE_BASE_IMAGE_OFFER: WindowsServer
15-
AZURE_CONTAINER_NAME: system
15+
AZURE_CONTAINER_NAME: windows2019
1616
AZURE_LOCATION: East US
1717
AZURE_PUBLISHER: pivotal
1818
AZURE_SKU: 2019-sku2

ci/tasks/azure-image-upload-and-start-publishing/run

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ set -euo pipefail
44
main_version=$(cat version/number)
55
uri_filename='bosh-stemcell-*-azure-vhd-uri.txt'
66
image_url=$(cat azure-base-vhd-uri/${uri_filename})
7-
vhd_path=$(echo "${image_url}" | sed -E 's/^.*(Microsoft\.Compute\/Images\/.*vhd).*$/\1/')
7+
vhd_filename=$(basename "${image_url}" | cut -d? -f1)
88

99
retrieve_blob_url() {
1010
retrieve_blob_url=$(
1111
az storage blob url \
1212
--container-name ${AZURE_CONTAINER_NAME} \
13-
--name ${vhd_path} \
13+
--name ${vhd_filename} \
1414
--account-name ${AZURE_PUBLISHED_STORAGE_ACCOUNT} \
1515
--account-key ${AZURE_PUBLISHED_STORAGE_ACCESS_KEY}
1616
)
@@ -89,11 +89,11 @@ copy_blob_to_premiumstore() {
8989
--source-account-key "${AZURE_STORAGE_ACCESS_KEY}" \
9090
--source-account-name "${AZURE_STORAGE_ACCOUNT}" \
9191
--source-container "${AZURE_CONTAINER_NAME}" \
92-
--source-blob "${vhd_path}" \
92+
--source-blob "${vhd_filename}" \
9393
--account-name "${AZURE_PUBLISHED_STORAGE_ACCOUNT}" \
9494
--account-key "${AZURE_PUBLISHED_STORAGE_ACCESS_KEY}" \
9595
--destination-container "${AZURE_CONTAINER_NAME}" \
96-
--destination-blob "${vhd_path}"
96+
--destination-blob "${vhd_filename}"
9797
}
9898

9999
wait_for_copy_blob_to_premiumstore() {
@@ -116,7 +116,7 @@ wait_for_copy_blob_to_premiumstore() {
116116
get_copy_blob_status() {
117117
az storage blob show \
118118
--container-name "${AZURE_CONTAINER_NAME}" \
119-
--name "${vhd_path}" \
119+
--name "${vhd_filename}" \
120120
--account-name "${AZURE_PUBLISHED_STORAGE_ACCOUNT}" \
121121
--account-key "${AZURE_PUBLISHED_STORAGE_ACCESS_KEY}" | jq -r ".properties.copy.status"
122122
}

0 commit comments

Comments
 (0)