diff --git a/example/dev-cluster.sh b/example/dev-cluster.sh new file mode 100755 index 000000000..e896b6baa --- /dev/null +++ b/example/dev-cluster.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -e + +SCRIPT_FOLDER="`dirname \"$0\"`" +REPO_FOLDER="${SCRIPT_FOLDER}/../" +GARAGE_DEBUG="${REPO_FOLDER}/target/debug/" +GARAGE_RELEASE="${REPO_FOLDER}/target/release/" +PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH" +FANCYCOLORS=("41m" "42m" "44m" "45m" "100m" "104m") + +export RUST_BACKTRACE=1 +export RUST_LOG=garage=info +MAIN_LABEL="\e[${FANCYCOLORS[0]}[main]\e[49m" + +for count in $(seq 1 3); do +CONF_PATH="/tmp/config.$count.toml" +LABEL="\e[${FANCYCOLORS[$count]}[$count]\e[49m" + +cat > $CONF_PATH <&1|while read r; do echo -en "$LABEL $r\n"; done) & +done + +until garage status 2>&1|grep -q Healthy ; do + echo -en "${MAIN_LABEL} cluster starting...\n" + sleep 1 +done +echo -en "${MAIN_LABEL} cluster started\n" + +wait