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ů.
 
 
 
 

48 řádky
1.3 KiB

  1. #!/bin/bash
  2. #
  3. # Reset the local "bubble" database
  4. #
  5. # Usage: reset_bubble_db [debug]
  6. #
  7. # debug : set this to 'debug' to enable debugging
  8. #
  9. SCRIPT="${0}"
  10. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  11. . ${SCRIPT_DIR}/bubble_common
  12. DEBUG=${1}
  13. if [[ ! -z "${DEBUG}" && "${DEBUG}" == "debug" ]] ; then
  14. DEBUG=1
  15. else
  16. DEBUG=0
  17. fi
  18. BUBBLE_SERVER="$(cd ${SCRIPT_DIR}/../bubble-server && pwd)"
  19. if [[ ! -d "${BUBBLE_SERVER}" ]] ; then
  20. die "bubble-server dir not found: ${BUBBLE_SERVER}"
  21. fi
  22. BUBBLE_TARGET=${BUBBLE_SERVER}/target
  23. META_DIR="${BUBBLE_TARGET}/classes/META-INF/bubble/"
  24. mkdir -p ${META_DIR} || die "Error creating META-INF dir: ${META_DIR}"
  25. SQL_DIR="${BUBBLE_SERVER}/target/classes/META-INF/"
  26. if [[ ! -d "${SQL_DIR}" ]] ; then
  27. die "config dir not found: ${SQL_DIR}"
  28. fi
  29. SQL_DIR="$(cd ${SQL_DIR} && pwd)"
  30. if [[ ${DEBUG} -eq 1 ]] ; then
  31. cd ${SCRIPT_DIR}/.. && \
  32. mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -Xnoagent -Djava.compiler=NONE" \
  33. -Dtest=bubble.test.DbInit -Ddb.dump=${SQL_DIR}/bubble.sql test \
  34. || exit 1
  35. else
  36. cd ${SCRIPT_DIR}/.. && \
  37. mvn -Dtest=bubble.test.DbInit -Ddb.dump=${SQL_DIR}/bubble.sql test || exit 1
  38. fi
  39. dropdb bubble ; createdb bubble && cat ${SQL_DIR}/bubble.sql | psql bubble
  40. echo "Successfully initialized DB schema from:"
  41. echo ${SQL_DIR}/bubble.sql