Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-boris committed Oct 23, 2024
1 parent 78e49da commit 8a7d9ad
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions imagesets/imageset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -737,21 +737,14 @@ function azure_update {
--architecture x64 \
--features SecurityType=Standard

if [ -z "${VERSION-}" ]; then
TASKCLUSTER_VERSION=0.0.1
else
TASKCLUSTER_VERSION="${VERSION#v}"
fi

IMAGE_VERSION_ID="$(retry az sig image-version show --gallery-image-definition="${IMAGE_SET}" --gallery-image-version="${TASKCLUSTER_VERSION}" --gallery-name="${IMAGE_SET//-/_}" --resource-group="${AZURE_IMAGE_RESOURCE_GROUP}" --query id --output tsv)"
if [ -n "${IMAGE_VERSION_ID}" ]; then
log "Deleting pre-existing image version ${TASKCLUSTER_VERSION} from shared image gallery ${IMAGE_SET//-/_}..."
log-iff-fails retry az sig image-version delete \
--resource-group="${AZURE_IMAGE_RESOURCE_GROUP}" \
--gallery-name="${IMAGE_SET//-/_}" \
--gallery-image-definition="${IMAGE_SET}" \
--gallery-image-version="${TASKCLUSTER_VERSION}"
fi
LAST_IMAGE_VERSION="$(cat azure_last_gallery_image_version)"
IFS='.' read -ra VERSION_ARRAY <<< "$(cat azure_last_gallery_image_version)"
# increment patch version by 1
VERSION_ARRAY[2]=$((VERSION_ARRAY[2] + 1))
NEW_IMAGE_VERSION="$(echo "${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}.${VERSION_ARRAY[2]}")"
echo $NEW_IMAGE_VERSION > azure_last_gallery_image_version
# git add 'azure_last_gallery_image_version'
# git commit -m "Update ${IMAGE_SET}/azure_last_gallery_image_version" || true

log "Creating image version ${TASKCLUSTER_VERSION} in shared image gallery ${IMAGE_SET//-/_}..."
log-iff-fails retry az sig image-version create \
Expand Down Expand Up @@ -826,7 +819,7 @@ function all-in-parallel {
echo

if [ -n "${USE_LATEST_TASKCLUSTER_VERSION}" ]; then
export VERSION="$(retry curl https://api.github.com/repos/taskcluster/taskcluster/releases/latest 2>/dev/null | jq -r .tag_name)"
VERSION="$(retry curl https://api.github.com/repos/taskcluster/taskcluster/releases/latest 2>/dev/null | jq -r .tag_name)"
if [ -z "${VERSION}" ]; then
echo "Cannot retrieve latest taskcluster version" >&2
return 64
Expand Down

0 comments on commit 8a7d9ad

Please sign in to comment.