The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

před 4 roky
před 4 roky
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
  4. #
  5. #
  6. # Usage:
  7. #
  8. # bpatch hostname
  9. #
  10. # hostname : the hostname of the bubble node to update
  11. # Usually you will have an entry in ~/.ssh/config to set the username and ssh key
  12. # norestart : If present, do not restart the API server after updating the jar file
  13. #
  14. # Patch the bubble.jar on a remote node.
  15. # This script only works if the only classes that have changed are in the bubble-server codebase.
  16. # If other classes have changed, use bpatchfull
  17. #
  18. # You install the JDK on the remote node first: apt install openjdk-11-jdk-headless
  19. #
  20. SCRIPT="${0}"
  21. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  22. . ${SCRIPT_DIR}/bubble_common
  23. HOST=${1:?no host provided}
  24. NO_RESTART=${2}
  25. BUBBLE_SERVER_DIR="${SCRIPT_DIR}/../bubble-server"
  26. if [[ ! -d "${BUBBLE_SERVER_DIR}" ]] ; then
  27. die "bubble-server dir not found: ${BUBBLE_SERVER_DIR}"
  28. fi
  29. cd ${BUBBLE_SERVER_DIR}
  30. mvn -DskipTests=true -Dcheckstyle.skip=true compile && rsync -avzc ./target/classes ${HOST}:/tmp/ | egrep -v '*/$' || die "Error recompiling classes"
  31. if [[ ! -z "${NO_RESTART}" && "${NO_RESTART}" == "norestart" ]] ; then
  32. echo "Patching but not restarting..."
  33. ssh ${HOST} "cd /tmp && cp ~bubble/current/bubble.jar . && cd classes && jar uvf ../bubble.jar . | egrep -v '*/\(*' && cat ../bubble.jar > ~bubble/current/bubble.jar" || die "Error patching remote jar"
  34. else
  35. echo "Patching and restarting..."
  36. ssh ${HOST} "cd /tmp && cp ~bubble/current/bubble.jar . && cd classes && jar uvf ../bubble.jar . | egrep -v '*/\(*' && cat ../bubble.jar > ~bubble/current/bubble.jar && supervisorctl restart bubble" || die "Error patching remote jar"
  37. fi