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.
 
 
 
 

48 regels
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. # Perform a full reset of Bubble. Removes the database and all locally stored files
  6. #
  7. # Usage: reset_bubble_full
  8. #
  9. SCRIPT="${0}"
  10. SCRIPT_DIR="$(cd "$(dirname "${SCRIPT}")" && pwd)"
  11. . "${SCRIPT_DIR}/bubble_common"
  12. SELF_NODE_JSON="${HOME}/self_node.json"
  13. BUBBLE_VERSIONS_FILE="${HOME}/bubble_versions.properties"
  14. BUBBLE_LOCAL_STORAGE_DIR_DEFAULT=".bubble_local_storage"
  15. BUBBLE_LOCAL_STORAGE_DIR="$("${SCRIPT_DIR}/bin/bconst" bubble.cloud.storage.local.LocalStorageDriver.BUBBLE_LOCAL_STORAGE_DIR)"
  16. if [[ -z ${BUBBLE_LOCAL_STORAGE_DIR} ]] ; then
  17. echo "Error determining Bubble LocalStorage directory, using default: ${BUBBLE_LOCAL_STORAGE_DIR_DEFAULT}"
  18. BUBBLE_LOCAL_STORAGE_DIR=${BUBBLE_LOCAL_STORAGE_DIR_DEFAULT}
  19. fi
  20. BUBBLE_LOCAL_STORAGE_DIR="${HOME}/${BUBBLE_LOCAL_STORAGE_DIR}"
  21. BUBBLE_CLOUD_DATA_DIR_DEFAULT="bubble_cloudServiceData"
  22. BUBBLE_CLOUD_DATA_DIR="$("${SCRIPT_DIR}/bin/bconst" bubble.ApiConstants.BUBBLE_CLOUD_SERVICE_DATA)"
  23. if [[ -z ${BUBBLE_CLOUD_DATA_DIR} ]] ; then
  24. echo "Error determining Bubble Cloud Service Data directory, using default: "
  25. BUBBLE_CLOUD_DATA_DIR=${BUBBLE_CLOUD_DATA_DIR_DEFAULT}
  26. fi
  27. BUBBLE_CLOUD_DATA_DIR="${HOME}/${BUBBLE_CLOUD_DATA_DIR}"
  28. rm -f "${SELF_NODE_JSON}" || die "Error removing ${SELF_NODE_JSON}"
  29. echo "> removed: ${SELF_NODE_JSON}"
  30. rm -f "${BUBBLE_VERSIONS_FILE}" || die "Error removing ${BUBBLE_VERSIONS_FILE}"
  31. echo "> removed: ${BUBBLE_VERSIONS_FILE}"
  32. rm -rf "${BUBBLE_LOCAL_STORAGE_DIR}" || die "Error removing ${BUBBLE_LOCAL_STORAGE_DIR}"
  33. echo "> removed: ${BUBBLE_LOCAL_STORAGE_DIR}"
  34. rm -rf "${BUBBLE_CLOUD_DATA_DIR}" || die "Error removing ${BUBBLE_CLOUD_DATA_DIR}"
  35. echo "> removed: ${BUBBLE_CLOUD_DATA_DIR}"
  36. dropdb bubble || die "Error dropping bubble database"
  37. echo "> dropped database: bubble"
  38. echo "+++ Bubble Reset Complete"