From beca1ef2fe29640c0146c7163080bf929e2f178f Mon Sep 17 00:00:00 2001 From: southerntofu Date: Sun, 19 Apr 2020 11:19:55 -0400 Subject: [PATCH] Honor PROJECT.host and $HOSTNAME/PROJECT.ignore --- git-build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/git-build.sh b/git-build.sh index 6a98635..550d4cc 100755 --- a/git-build.sh +++ b/git-build.sh @@ -47,6 +47,16 @@ if [[ ${#PROJECTS[*]} = 0 ]]; then fi for p_name in ${PROJECTS[*]}; do + # Check if task should run on host + if [[ $LOCAL = 0 ]]; then + if [ -f $BASEDIR/$p_name.host ] && [[ "$(cat $BASEDIR/$p_name.host)" != "$HOSTNAME" ]]; then + # The task is specifically configured for a different host, ignore + echo "[$p_name] SKIPPED" + continue + fi + # The task has a PROJECT.ignore file in host config, ignore + [ -f $BASEDIR/$HOSTNAME/$p_name.ignore ] && echo "[$p_name] IGNORED" && continue + fi echo "[$p_name] START" [ -f $BASEDIR/$p_name.branch ] && p_branch="$(cat $BASEDIR/$p_name.branch)" || p_branch="master" p_dir="$BASEDIR/.$p_name"