Skip to content

Commit 564392e

Browse files
committed
Make execution relative to root
1 parent 9642374 commit 564392e

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

.github/workflows/build-docker-artifacts.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -325,25 +325,24 @@ jobs:
325325
- name: Test images
326326
shell: bash
327327
run: |
328-
directory="./deploy/build/"${{ matrix.flavor.directory }}""
329-
cd "$directory"
330-
331-
# Iterate through all components and store their image ref in an environment variable
332-
for component in $(jq -c '.components[]' <<< "$FLAVOR"); do
333-
name=$(jq -r '.ecr_repository' <<< "$component")
334-
image_ref=$(jq -r '.image_ref' <<< "$component")
335-
# Replace all non-alphanumeric characters with underscores and convert to uppercase
336-
name_upper=$(echo "${name//[^[:alnum:]]/_}" | tr '[:lower:]' '[:upper:]')
337-
echo "Setting environment variable IMAGE_$name_upper=$image_ref"
338-
export "IMAGE_$name_upper=$image_ref"
339-
done;
340-
341-
if [[ -f "./hooks/test_images.sh" ]]; then
342-
echo "Run test_images.sh in $directory"
343-
chmod +x ./hooks/test_images.sh
344-
./hooks/test_images.sh
328+
test_images_hook="./deploy/build/${{ matrix.flavor.directory }}/hooks/test_images.sh"
329+
330+
if [[ -f "$test_images_hook" ]]; then
331+
# Iterate through all components and store their image ref in an environment variable
332+
for component in $(jq -c '.components[]' <<< "$FLAVOR"); do
333+
name=$(jq -r '.ecr_repository' <<< "$component")
334+
image_ref=$(jq -r '.image_ref' <<< "$component")
335+
# Replace all non-alphanumeric characters with underscores and convert to uppercase
336+
name_upper=$(echo "${name//[^[:alnum:]]/_}" | tr '[:lower:]' '[:upper:]')
337+
echo "Setting environment variable IMAGE_$name_upper=$image_ref"
338+
export "IMAGE_$name_upper=$image_ref"
339+
done;
340+
341+
echo "Run $test_images_hook"
342+
chmod +x "$test_images_hook"
343+
"$test_images_hook"
345344
else
346-
echo "No hooks/test_images.sh found in $directory, skipping tests"
345+
echo "No $test_images_hook found, skipping tests."
347346
fi
348347
env:
349348
FLAVOR: ${{ toJSON(matrix.flavor) }}

0 commit comments

Comments
 (0)