Skip to content

Commit 85facdb

Browse files
authored
Fix release workflow (#789)
* Fix release workflow - The enumerate-product-versions.py would not work because it can't find the module "conf" since it was moved to the .scripts subfolder - Changes the release workflow to fail when the enumerate script fails. It used to just swallow the error * Silence yamllint * Add notes
1 parent c0acf35 commit 85facdb

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ jobs:
9797
# Bake images and load them to local docker repo for signing
9898
# TODO: buildx cannot --load and --push at the same time
9999
# Tagging images with the architecture they were build on
100-
ARCH_FOR_DOCKER="$(arch | sed -e 's#x86_64#amd64#' | sed -e 's#aarch64#arm64#')"
100+
ARCH="$(uname -m | sed -e 's#x86_64#amd64#' | sed -e 's#aarch64#arm64#')"
101101
bake --product "${{ matrix.product }}" \
102-
--image-version "${GITHUB_REF_NAME}-${ARCH_FOR_DOCKER}" \
103-
--architecture "linux/${ARCH_FOR_DOCKER}" \
102+
--image-version "${GITHUB_REF_NAME}-${ARCH}" \
103+
--architecture "linux/${ARCH}" \
104104
--organization stackable \
105105
--shard-count "${{matrix.shard_count}}" \
106106
--shard-index "${{matrix.shard_index}}" \
@@ -187,7 +187,12 @@ jobs:
187187
DOCKER_USER: github
188188
DOCKER_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
189189
run: |
190-
for product_and_version in $(python3 .scripts/enumerate-product-versions.py); do
190+
if ! product_and_versions=$(python3 .scripts/enumerate-product-versions.py); then
191+
echo "Python script failed"
192+
exit 1
193+
fi
194+
195+
for product_and_version in $product_and_versions; do
191196
PRODUCT="$(echo "$product_and_version" | cut -d '#' -f 1)"
192197
VERSION="$(echo "$product_and_version" | cut -d '#' -f 2)"
193198

.scripts/enumerate-product-versions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
import sys
2+
import os
3+
4+
# NOTE: This script (used in the release workflow as of 2024-07-23) relies on conf.py being in its parent folder. Should either file be moved or the structure changed in any way remember to update this script as well.
5+
# Add parent directory to the sys.path
6+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
7+
18
import conf
29

310
PRODUCTS = [

conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
Application images will be created for products and associated versions configured here.
55
"""
66

7+
# NOTE: The .scripts/enumerate-product-versions.py script (used in the release workflow as of 2024-07-23) imports this file and it relies on conf.py being in its parent folder. Should this file be moved or the structure changed in any way remember to update that script as well!
8+
79
# NOTE (@NickLarsenNZ): Unfortunately, some directories have hyphens, so they need
810
# importing in a special way. For consistency, we'll do them all the same way.
911
import importlib

0 commit comments

Comments
 (0)