#!/bin/sh
# Check Autodeploy repos status.
# If there are changes or uncommitted, autodeploy will not trigger.

THIS_FILE="`realpath "$0"`"
THIS_DIR="`dirname "$THIS_FILE"`"
COMPOSE_DIR="`dirname "$THIS_DIR"`"

if [ -f "$COMPOSE_DIR/read-configs.include.sh" ]; then
    . "$COMPOSE_DIR/read-configs.include.sh"

    # Get AUTODEPLOY_EXTRA_REPOS
    read_configs
fi

for r in $COMPOSE_DIR $AUTODEPLOY_EXTRA_REPOS; do
    echo "=== $r"
    cd $r
    git status -v
    cd -
done
