rebuild.sh 725 Bytes
Newer Older
1 2
#!/bin/sh

3 4
/usr/bin/env

5 6
BASE=""
LATE=""
7

8
export REVISION=$(git log --pretty=format:'%h' -n 1)
9
CHANGED=$(for i in `git log --name-only --pretty=oneline --full-index $GIT_PREVIOUS_COMMIT..$GIT_COMMIT | grep -vE '^[0-9a-f]{40} '`; do echo `dirname $i`; done | sort | uniq)
10

11 12 13 14 15
for dir in $CHANGED; do
    case $dir in
        videolan-base*)
            BASE="$BASE $dir"
            ;;
16 17
        .)
            ;;
18 19 20 21 22
        *)
            LATE="$LATE $dir"
            ;;
    esac
done
23

24 25
echo "Changed base images: '$BASE'"
echo "Changed late images: '$LATE'"
26

27
for b in $BASE; do
28
    make -C $b build
29
    make -C $b push
30
    make -C $b swarm
31 32
done

33
for l in $LATE; do
34
    make -C $l build
35
    make -C $l push
36
    make -C $l swarm
37
done