From 7523e680ae9feacaa54df13de80fa82a2b2e7b74 Mon Sep 17 00:00:00 2001 From: Damon Barry Date: Tue, 30 Apr 2024 13:22:11 -0700 Subject: [PATCH] Get identity service version from source instead of tag (#7280) The Mariner arm64 build is currently failing. When it builds identity service bits, it tries to populate the version by getting the latest 1.5.* tag from the identity service repo. There are no 1.5.* tags yet, so it sends an empty version which causes `make` to fail. The root cause is that we bumped our release version in code much sooner than we normally do (i.e., the period of time between bumping the version in code and actually publishing the bits is usually hours, but this time it's a couple weeks). The fix is to extract the version from checked-in sources rather than git tag, since the tag isn't set until after we release. To test, I ran the CI Build pipeline and confirmed that Mariner arm64 passes. ## Azure IoT Edge PR checklist: --- builds/misc/templates/build-packages.yaml | 7 ++++++- scripts/linux/github/updateLatestVersion.sh | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/builds/misc/templates/build-packages.yaml b/builds/misc/templates/build-packages.yaml index 142a109c364..2821bd49107 100644 --- a/builds/misc/templates/build-packages.yaml +++ b/builds/misc/templates/build-packages.yaml @@ -318,7 +318,12 @@ stages: set -ex git clone --recurse-submodules --branch main https://github.com/Azure/iot-identity-service.git pushd iot-identity-service - packageVersion=$(git tag | grep 1.5.[0-9]*$ | sort --version-sort -r | head -1) + packageVersion=$( + grep "PACKAGE_VERSION:" .github/workflows/packages.yaml \ + | awk '{print $2}' \ + | tr -d "'" \ + | tr -d '"' + ) sudo docker run --rm \ -v "$(Build.SourcesDirectory)/iot-identity-service:/src" \ -e "ARCH=$PACKAGE_ARCH" \ diff --git a/scripts/linux/github/updateLatestVersion.sh b/scripts/linux/github/updateLatestVersion.sh index dddcf6bdde0..1f193608b4c 100755 --- a/scripts/linux/github/updateLatestVersion.sh +++ b/scripts/linux/github/updateLatestVersion.sh @@ -175,9 +175,9 @@ update_product_versions_json() proposedEdgeletVersion=$(cat $IOTEDGE_REPO_PATH/edgelet/version.txt) proposedCoreImageVersion=$(cat $IOTEDGE_REPO_PATH/versionInfo.json | jq -r '.version') proposedIisVersion=$( - grep "PACKAGE_VERSION:" $IIS_REPO_PATH/.github/workflows/packages.yaml - | awk '{print $2}' - | tr -d "'" + grep "PACKAGE_VERSION:" $IIS_REPO_PATH/.github/workflows/packages.yaml \ + | awk '{print $2}' \ + | tr -d "'" \ | tr -d '"' )