The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

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