Updated the deployment script to work with my setup.

This commit is contained in:
Tobias Ottenweller 2013-06-05 21:16:31 +02:00
parent 49e5f61f19
commit 3e975c3093

View File

@ -2,15 +2,23 @@
SCRIPT_DIR="$(dirname "$0")" SCRIPT_DIR="$(dirname "$0")"
BUKKIT_DIR="$SCRIPT_DIR/../bukkit-testserver" DEVELOPER=$(whoami)
PLUGIN_DIR="$SCRIPT_DIR/../bukkit-testserver/plugins"
if [ $DEVELOPER = "tobi" ]; then
BUKKIT_DIR="$HOME/minecraft/testbuk"
PLUGIN_DIR="$HOME/minecraft/testbuk/plugins"
START_STOP_SCRIPT="$BUKKIT_DIR/../minecraft.sh"
else
BUKKIT_DIR="$SCRIPT_DIR/../bukkit-testserver"
PLUGIN_DIR="$SCRIPT_DIR/../bukkit-testserver/plugins"
START_STOP_SCRIPT="$SCRIPT_DIR/minecraft.sh"
fi
# TODO: This is a bad solution! Maven should write necessary information into an extra file. # TODO: This is a bad solution! Maven should write necessary information into an extra file.
ARTIFACT_ID="$(grep -C5 '<groupId>de.craftinc' "$SCRIPT_DIR/../pom.xml" | grep '<name>' | sed 's/\s*<name>//g' | sed 's/<\/name>\s*//g')" ARTIFACT_ID="$(grep -C5 '<groupId>de.craftinc' "$SCRIPT_DIR/../pom.xml" | grep '<name>' | sed 's/[ \t]*<name>//g' | sed 's/<\/name>[ \t]*//g')"
# TODO: This is a bad solution! Maven should write necessary information into an extra file. # TODO: This is a bad solution! Maven should write necessary information into an extra file.
VERSION="$(grep -C5 '<groupId>de.craftinc' "$SCRIPT_DIR/../pom.xml" | grep '<version>' | sed 's/\s*<version>//g' | sed 's/<\/version>\s*//g')" VERSION="$(grep -C5 '<groupId>de.craftinc' "$SCRIPT_DIR/../pom.xml" | grep '<version>' | sed 's/[ \t]*<version>//g' | sed 's/<\/version>[ \t]*//g')"
mkdir -p "$PLUGIN_DIR" mkdir -p "$PLUGIN_DIR"
@ -18,4 +26,4 @@ cp "$SCRIPT_DIR/../target/$ARTIFACT_ID $VERSION".jar "$PLUGIN_DIR/"
echo -e "ddidderr\nmice_on_drugs\nMochaccino" > "$BUKKIT_DIR/ops.txt" echo -e "ddidderr\nmice_on_drugs\nMochaccino" > "$BUKKIT_DIR/ops.txt"
"$SCRIPT_DIR/minecraft.sh" reload_or_start $START_STOP_SCRIPT reload_or_start