|
|
@@ -27,6 +27,10 @@ SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd) |
|
|
|
HOST=${1:?no host provided} |
|
|
|
NO_RESTART=${2} |
|
|
|
|
|
|
|
if [[ -z "$(echo "${HOST}" | tr -cd '[:alnum:].-')" ]] ; then |
|
|
|
die "invalid host: ${HOST}" |
|
|
|
fi |
|
|
|
|
|
|
|
BUBBLE_SERVER_DIR="${SCRIPT_DIR}/../bubble-server" |
|
|
|
if [[ ! -d "${BUBBLE_SERVER_DIR}" ]] ; then |
|
|
|
die "bubble-server dir not found: ${BUBBLE_SERVER_DIR}" |
|
|
@@ -36,9 +40,9 @@ cd ${BUBBLE_SERVER_DIR} |
|
|
|
mvn -DskipTests=true -Dcheckstyle.skip=true compile && rsync -avzc ./target/classes ${HOST}:/tmp/ | egrep -v '*/$' || die "Error recompiling classes" |
|
|
|
|
|
|
|
if [[ ! -z "${NO_RESTART}" && "${NO_RESTART}" == "norestart" ]] ; then |
|
|
|
echo "Patching but not restarting..." |
|
|
|
echo "Patching but not restarting: ${HOST} ..." |
|
|
|
ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cd /tmp && cp ~bubble/api/bubble.jar . && cd classes && jar uvf ../bubble.jar . | egrep -v '*/\(*' && cat ../bubble.jar > ~bubble/api/bubble.jar" || die "Error patching remote jar" |
|
|
|
else |
|
|
|
echo "Patching and restarting..." |
|
|
|
echo "Patching and restarting: ${HOST} ..." |
|
|
|
ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cd /tmp && cp ~bubble/api/bubble.jar . && cd classes && jar uvf ../bubble.jar . | egrep -v '*/\(*' && cat ../bubble.jar > ~bubble/api/bubble.jar && supervisorctl restart bubble" || die "Error patching remote jar" |
|
|
|
fi |