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

50 řádky
1.5 KiB

  1. #!/bin/bash
  2. #
  3. # Run a local JSON API script against a remote API server
  4. #
  5. # Usage:
  6. #
  7. # run-script script-file [options] [args]
  8. #
  9. # script-file : a JSON API script
  10. # options : script options, see bubble.main.BubbleScriptOptions (and parent classes) for more info
  11. # args : a JSON object representing arguments to the script.
  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_INCLUDE : path to look for JSON include files. default value is to assume we are being run from
  19. # bubble repo, bubble-models repo, or bubble-client and use include files from minimal model.
  20. #
  21. SCRIPT="${0}"
  22. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  23. . ${SCRIPT_DIR}/bubble_common
  24. BUBBLE_SERVER=$(cd $(dirname ${0})/.. && pwd)
  25. CANDIDATE_INCLUDES="
  26. ${BUBBLE_SERVER}/src/test/resources/models/minimal/tests
  27. ${BUBBLE_SERVER}/resources/models/minimal/tests
  28. ${SCRIPT_DIR}/models/minimal/tests
  29. "
  30. if [[ -z "${BUBBLE_INCLUDE}" ]] ; then
  31. for include in ${CANDIDATE_INCLUDES} ; do
  32. if [[ -d ${include} ]] ; then
  33. BUBBLE_INCLUDE="$(cd ${include} && pwd)"
  34. break
  35. fi
  36. done
  37. fi
  38. if [[ ! -z "${BUBBLE_INCLUDE}" ]] ; then
  39. BUBBLE_INCLUDE="-I ${BUBBLE_INCLUDE}"
  40. fi
  41. SCRIPT=${1:?no JSON script provided}
  42. shift
  43. ARGS=$(quote_args "$@")
  44. exec ${SCRIPT_DIR}/bubble script -H ${BUBBLE_INCLUDE} ${ARGS} ${SCRIPT}