Skip to content

Commit 97a77ca

Browse files
authored
Merge pull request #2088 from gooddata/lcm-stable-latest-digest
fix(lcm): point stable latest at the promoted version digest
2 parents 0fb7021 + fffd2fb commit 97a77ca

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎.github/workflows/promote-to-stable.yaml‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,24 @@ jobs:
4848

4949
- name: Promote images
5050
run: |
51+
set -euo pipefail
5152
built_images='${{ inputs.images }}'
5253
tag=${{ inputs.image_tag }}
5354
for image in $(echo "$built_images" | jq -r '.[]'); do
5455
crane cp \
5556
"${INFRA_REPO_URL}/staging/${image}:${tag}" \
5657
"${INFRA_REPO_URL}/stable/${image}:${tag}"
57-
crane cp \
58-
"${INFRA_REPO_URL}/staging/${image}:latest" \
59-
"${INFRA_REPO_URL}/stable/${image}:latest"
58+
# latest must be the digest just promoted, not whatever staging:latest is now
59+
crane tag "${INFRA_REPO_URL}/stable/${image}:${tag}" latest
60+
61+
promoted=$(crane digest "${INFRA_REPO_URL}/stable/${image}:${tag}")
62+
current=$(crane digest "${INFRA_REPO_URL}/stable/${image}:latest")
63+
if [[ "${promoted}" != "${current}" ]]; then
64+
echo "::error::stable/${image}:latest (${current}) != :${tag} (${promoted})"
65+
exit 1
66+
fi
6067
61-
echo "Promoted image ${image} to stable"
68+
echo "Promoted image ${image} to stable as ${tag} + latest"
6269
done
6370
6471
- name: Promote charts

0 commit comments

Comments
 (0)