Honor PROJECT.host and $HOSTNAME/PROJECT.ignore

This commit is contained in:
southerntofu 2020-04-19 11:19:55 -04:00
parent a3870ffaf4
commit beca1ef2fe
1 changed files with 10 additions and 0 deletions

View File

@ -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"