The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

53 rindas
1.7 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. # Run a local JSON API script against a remote API server
  7. #
  8. # Usage:
  9. #
  10. # run-script script-file [options] [args]
  11. #
  12. # script-file : a JSON API script
  13. # options : script options, see bubble.main.BubbleScriptOptions (and parent classes) for more info
  14. # args : a JSON object representing arguments to the script.
  15. #
  16. # Environment variables
  17. #
  18. # BUBBLE_API : which API to use. Default is local (http://127.0.0.1:PORT, where PORT is found in .bubble.env)
  19. # BUBBLE_USER : account to use. Default is root
  20. # BUBBLE_PASS : password for account. Default is root
  21. # BUBBLE_INCLUDE : path to look for JSON include files. default value is to assume we are being run from
  22. # bubble repo, bubble-models repo, or bubble-client and use include files from minimal model.
  23. #
  24. SCRIPT="${0}"
  25. SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
  26. . ${SCRIPT_DIR}/bubble_common
  27. BUBBLE_SERVER=$(cd $(dirname ${0})/.. && pwd)
  28. CANDIDATE_INCLUDES="
  29. ${BUBBLE_SERVER}/src/test/resources/models/minimal/tests
  30. ${BUBBLE_SERVER}/resources/models/minimal/tests
  31. ${SCRIPT_DIR}/models/minimal/tests
  32. "
  33. if [[ -z "${BUBBLE_INCLUDE}" ]] ; then
  34. for include in ${CANDIDATE_INCLUDES} ; do
  35. if [[ -d ${include} ]] ; then
  36. BUBBLE_INCLUDE="$(cd ${include} && pwd)"
  37. break
  38. fi
  39. done
  40. fi
  41. if [[ ! -z "${BUBBLE_INCLUDE}" ]] ; then
  42. BUBBLE_INCLUDE="-I ${BUBBLE_INCLUDE}"
  43. fi
  44. SCRIPT=${1:?no JSON script provided}
  45. shift
  46. ARGS=$(quote_args "$@")
  47. exec ${SCRIPT_DIR}/bubble script -H ${BUBBLE_INCLUDE} ${ARGS} ${SCRIPT}