The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

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