neoloc/workflows (#6)
Deploy / build (push) Failing after 3s

Reviewed-on: https://git.query.consul/unkin/packer-images/pulls/6
This commit was merged in pull request #6.
This commit is contained in:
2025-01-25 18:28:39 +11:00
parent d503b0c28d
commit b1cc207781
9 changed files with 79 additions and 15 deletions
+5 -4
View File
@@ -1,6 +1,7 @@
#!/bin/bash
# Check for changes in images/ folder and the builds/ folder
git fetch origin master:master
if [ "$(git branch --show-current)" = "master" ]; then
builds_changes=$(git diff --name-only HEAD^...master | grep -E '^builds/')
images_changes=$(git diff --name-only HEAD^...master | grep -E '^images/')
@@ -11,7 +12,7 @@ fi
# Run `make all` if there are changes in builds/
if [ -n "$builds_changes" ]; then
echo "Changes detected in builds/. Running 'make build-all'..."
echo "Changes detected in builds/. Running 'make all'..."
make all
fi
@@ -20,9 +21,9 @@ if [ -n "$images_changes" ]; then
echo "Changes detected in images/. Running specific 'make' commands..."
# Extract unique paths for `make` commands
for file in $images_changes; do
# Get the subdirectory path for the make command (e.g., almalinux/8.10/actionsdind)
target=$(echo "$file" | sed -E 's|images/||; s|/[^/]+$||')
export TARGETS=$(echo "$images_changes" | sed -E 's|images/||; s|/[^/]+$||' | sort -u)
echo $TARGETS
for target in $TARGETS; do
echo "Running 'make $target'..."
make "$target"
done