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.
 
 
 
 

39 regels
1.1 KiB

  1. #!/bin/bash
  2. #
  3. # Write a model to a bubble server
  4. #
  5. # Usage: model [-u/--update-all] model-file
  6. #
  7. # -u or --update : if present, every entity that is not otherwise created will be updated
  8. # model-file : a manifest.json file or a single model JSON file
  9. #
  10. # Environment variables
  11. #
  12. # BUBBLE_API : which API to use. Default is local (http://127.0.0.1:PORT, where PORT is found in .bubble.env)
  13. # BUBBLE_USER : account to use. Default is root
  14. # BUBBLE_PASS : password for account. Default is root
  15. # BUBBLE_SCRIPTS : location of run.sh script. Default is to assume it is in the same directory containing this script
  16. #
  17. SCRIPT="${0}"
  18. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  19. . ${SCRIPT_DIR}/bubble_common
  20. UPDATE_OPT=""
  21. if [[ ! -z "${1}" && ( "${1}" == "-u" || "${1}" == "--update-all" ) ]] ; then
  22. UPDATE_OPT="--update-all"
  23. shift
  24. fi
  25. MODEL="${1:?no manifest or model file specified}"
  26. shift
  27. is_manifest="$(basename ${MODEL} | grep "manifest" | wc -c | tr -d ' ')"
  28. if [[ ${is_manifest} -gt 0 ]] ; then
  29. MODEL_OPT="-m"
  30. else
  31. MODEL_OPT="-f"
  32. fi
  33. ${SCRIPT_DIR}/bubble model ${UPDATE_OPT} ${MODEL_OPT} "${MODEL}"