|
@@ -21,9 +21,13 @@ SCRIPT="${0}" |
|
|
SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd) |
|
|
SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd) |
|
|
. ${SCRIPT_DIR}/bubble_common |
|
|
. ${SCRIPT_DIR}/bubble_common |
|
|
|
|
|
|
|
|
HOST=${1:?no host provided} |
|
|
|
|
|
|
|
|
HOST="${1:?no host provided}" |
|
|
NO_RESTART=${2} |
|
|
NO_RESTART=${2} |
|
|
|
|
|
|
|
|
|
|
|
if [[ -z "$(echo "${HOST}" | tr -cd '[:alnum:].-')" ]] ; then |
|
|
|
|
|
die "invalid host: ${HOST}" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
if [[ -z "${BUBBLE_SSH_PORT}" ]] ; then |
|
|
if [[ -z "${BUBBLE_SSH_PORT}" ]] ; then |
|
|
BUBBLE_SSH_PORT="1202" |
|
|
BUBBLE_SSH_PORT="1202" |
|
|
fi |
|
|
fi |
|
@@ -55,14 +59,14 @@ else |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if [[ ! -z "${NO_RESTART}" && "${NO_RESTART}" == "norestart" ]] ; then |
|
|
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} "cat /tmp/bubble.jar > ~bubble/api/bubble.jar" |
|
|
ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cat /tmp/bubble.jar > ~bubble/api/bubble.jar" |
|
|
else |
|
|
else |
|
|
echo "Patching and restarting..." |
|
|
|
|
|
|
|
|
echo "Patching and restarting: ${HOST} ..." |
|
|
ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cat /tmp/bubble.jar > ~bubble/api/bubble.jar && supervisorctl restart bubble" |
|
|
ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cat /tmp/bubble.jar > ~bubble/api/bubble.jar && supervisorctl restart bubble" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if unzip -Z -1 ./target/bubble*.jar | grep -q "^site/$" ; then |
|
|
if unzip -Z -1 ./target/bubble*.jar | grep -q "^site/$" ; then |
|
|
echo "Deploying new web..." |
|
|
|
|
|
|
|
|
echo "Deploying new web: ${HOST} ..." |
|
|
ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cd ~bubble && unzip -o /tmp/bubble.jar 'site/*' && chown -R bubble:bubble site" |
|
|
ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cd ~bubble && unzip -o /tmp/bubble.jar 'site/*' && chown -R bubble:bubble site" |
|
|
fi |
|
|
fi |