rebuild-ci.sh 490 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/bin/sh

set -e

/usr/bin/env

DIRS=""

CHANGED=$(for i in `git log --name-only --pretty=oneline --full-index $CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA | grep -vE '^[0-9a-f]{40} '`; do echo `dirname $i`; done | sort | uniq)

for dir in $CHANGED; do
    case "$dir" in
        ".")
            ;;
        *)
            DIRS="$DIRS $dir"
            ;;
    esac
done

echo "Changed images: '$DIRS'"

for d in $DIRS; do
    [ -d "$d" ] || continue
    make -C $d build
    make -C $d push
done