The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

53 rivejä
1.9 KiB

  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. # Prepares the bubble.jar file for active usage.
  7. #
  8. # 1. Copy scripts to bubble-server/target/classes/scripts
  9. #
  10. # 2. If the environment variable INSTALL_WEB is equal to "web", also build and install the bubble-web
  11. # site to bubble-server/target/classes/site
  12. #
  13. # Usage:
  14. #
  15. # prep_bubble_jar
  16. #
  17. # Environment variables:
  18. #
  19. # INSTALL_WEB : if this is equal to 'web' then the frontend will be built and included in the jar
  20. # DEBUG_BUILD : if this is equal to 'debug' then nothing will be done, the jar will be left as-is
  21. #
  22. SCRIPT="${0}"
  23. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  24. . ${SCRIPT_DIR}/bubble_common
  25. if [[ ! -z "${DEBUG_BUILD}" && "${DEBUG_BUILD}" == "debug" ]] ; then
  26. echo "DEBUG_BUILD is set, not doing anything further"
  27. exit 0
  28. fi
  29. BUBBLE_SERVER="$(cd "${SCRIPT_DIR}/../bubble-server" && pwd)"
  30. CLASSES_DIR="${BUBBLE_SERVER}/target/classes"
  31. if [[ -z "${BUBBLE_JAR}" ]] ; then
  32. die "bubble jar not found: ${BUBBLE_JAR}"
  33. fi
  34. mkdir -p ${CLASSES_DIR}/scripts
  35. for script in $(cat ${BUBBLE_SERVER}/src/main/resources/ansible/bubble_scripts.txt) ; do
  36. cp ${SCRIPT_DIR}/${script} ${CLASSES_DIR}/scripts || die "Error copying ${SCRIPT_DIR}/${script} -> ${CLASSES_DIR}/scripts"
  37. done
  38. cd ${CLASSES_DIR} && jar uvf ${BUBBLE_JAR} scripts || die "Error updating ${BUBBLE_JAR} with scripts"
  39. if [[ ! -z "${INSTALL_WEB}" && "${INSTALL_WEB}" == "web" ]] ; then
  40. mkdir -p ${CLASSES_DIR}/site
  41. BUBBLE_WEB="$(cd "${SCRIPT_DIR}/../bubble-web" && pwd)"
  42. cd ${BUBBLE_WEB} && npm install && webpack || die "Error building bubble-web"
  43. cp -R ${BUBBLE_WEB}/dist/* ${CLASSES_DIR}/site/ || die "Error copying ${BUBBLE_WEB}/dist/* -> ${CLASSES_DIR}/site/"
  44. cd ${CLASSES_DIR} && jar uvf ${BUBBLE_JAR} site || die "Error updating ${BUBBLE_JAR} with site"
  45. echo "Installed bubble-web to ${CLASSES_DIR}/site/"
  46. fi