Quellcode durchsuchen

change default ssh port for bpatch and bpatchfull

tags/v1.2.3
Jonathan Cobb vor 4 Jahren
Ursprung
Commit
3ff0813097
2 geänderte Dateien mit 20 neuen und 8 gelöschten Zeilen
  1. +7
    -3
      bin/bpatch
  2. +13
    -5
      bin/bpatchfull

+ 7
- 3
bin/bpatch Datei anzeigen

@@ -17,6 +17,10 @@
#
# You install the JDK on the remote node first: apt install openjdk-11-jdk-headless
#
# Environment variables:
#
# BUBBLE_SSH_PORT : SSH port, default is 1202
#
SCRIPT="${0}"
SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
. ${SCRIPT_DIR}/bubble_common
@@ -34,8 +38,8 @@ mvn -DskipTests=true -Dcheckstyle.skip=true compile && rsync -avzc ./target/clas

if [[ ! -z "${NO_RESTART}" && "${NO_RESTART}" == "norestart" ]] ; then
echo "Patching but not restarting..."
ssh ${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"
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..."
ssh ${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
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

+ 13
- 5
bin/bpatchfull Datei anzeigen

@@ -14,6 +14,10 @@
# Patch the bubble.jar on a remote node.
# This script updates the entire jar file, and takes a lot longer than bpatch
#
# Environment variables
#
# BUBBLE_SSH_PORT : SSH port, default is 1202
#
SCRIPT="${0}"
SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
. ${SCRIPT_DIR}/bubble_common
@@ -21,6 +25,10 @@ SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
HOST=${1:?no host provided}
NO_RESTART=${2}

if [[ -z "${BUBBLE_SSH_PORT}" ]] ; then
BUBBLE_SSH_PORT="1202"
fi

BUBBLE_SERVER_DIR="${SCRIPT_DIR}/../bubble-server"
if [[ ! -d "${BUBBLE_SERVER_DIR}" ]] ; then
die "bubble-server dir not found: ${BUBBLE_SERVER_DIR}"
@@ -35,7 +43,7 @@ else
fi
if [[ ${ANY_CHANGES} -eq 0 ]] ; then
echo "No changes, not repackaging jar"
scp ./target/bubble*.jar ${HOST}:/tmp/bubble.jar || die "Error copying file to remote host ${HOST}"
scp -P ${BUBBLE_SSH_PORT} ./target/bubble*.jar ${HOST}:/tmp/bubble.jar || die "Error copying file to remote host ${HOST}"
else
if [[ ${ANY_JAR} -eq 0 ]] ; then
echo "No bubble jar file found, rebuilding"
@@ -44,18 +52,18 @@ else
find "./src/main" -type f -newer "$(find "./target" -type f -name "bubble*.jar" | head -1)"
fi
BUBBLE_PRODUCTION=1 mvn -DskipTests=true -Dcheckstyle.skip=true clean package || die "Error packaging jar"
scp ./target/bubble*.jar ${HOST}:/tmp/bubble.jar || die "Error copying file to remote host ${HOST}"
scp -P ${BUBBLE_SSH_PORT} ./target/bubble*.jar ${HOST}:/tmp/bubble.jar || die "Error copying file to remote host ${HOST}"
fi

if [[ ! -z "${NO_RESTART}" && "${NO_RESTART}" == "norestart" ]] ; then
echo "Patching but not restarting..."
ssh ${HOST} "cat /tmp/bubble.jar > ~bubble/api/bubble.jar"
ssh -p ${BUBBLE_SSH_PORT} ${HOST} "cat /tmp/bubble.jar > ~bubble/api/bubble.jar"
else
echo "Patching and restarting..."
ssh ${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

if unzip -Z -1 ./target/bubble*.jar | grep -q "^site/$" ; then
echo "Deploying new web..."
ssh ${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

Laden…
Abbrechen
Speichern