echo ">>> Invoker not installed, please install"
exit 1
fi
}
echo ">>> Invoker running, restarting..."
else
echo ">>> Invoker not running, starting..."
fi
}
cmd="$1"
}
# An empty expression will not be checked. This in fact means, that there is no
# check for 'empty-output', but seeing as that should probably be never the
# case it is a good way to combine both execute_or... versions
cmd="$1"
expression="$2"
state="$?"
else
fi
else
fi
}
# Currently the match cannot be a 'normal' regular expression.
# This however can be changed by adding a 'P' to the switches list for the
# grep-command.
result="$1"
expression="$2"
cmd="$3"
matchstate="$?"
else
fi
}
cmd="$1"
message="$2"
exit 1
}
cmd="$1"
}
cmd="$1"
success="$2"
print_colored_or_not ">>> Executed '$cmd'!" "32"
else
print_colored_or_not ">>> Executed '$cmd'!" "31"
fi
}
cmd="$1"
print_colored_or_not " >> Failed to execute '$cmd', but ignoring the result." "33"
}
cmd="$1"
failed_message="$2"
print_colored_or_not " >> Failed to execute '$cmd', aborting further commands." "31"
echo " > Message:"
echo "$failed_message"
fi
}
message="$1"
color_code="$2"
echo -e "\033[${color_code}m${message}\033[0m"
else
echo "$message"
fi
}
run_invoker="1"
colored_output="1"
cd $cwd
export GIT_HOME="${GIT_HOME:-$rails_root/tmp/git}"
for i in "$@"; do
case $i in
export DOWNLOAD_FIXTURES=true
;;
-r|--restart)
RESTART_INVOKER_ONLY=true
;;
run_invoker="0"
;;
colored_output="0"
;;
*)
# unknown option
;;
esac
shift
done
fi
if [[ !($RESTART_INVOKER_ONLY) ]]; then
execute_or_die_unless_match "bundle exec rake elasticsearch:wipe" "Elasticsearch::Transport::Transport::Errors::NotFound"
execute_or_die "bundle exec rake db:migrate:clean"
execute_or_die "redis-cli flushdb"
execute_or_die "bundle exec rake git:compile_cp_keys"
execute_or_die "bundle exec rake db:seed"
fi