uig.sh 966 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh -e
  2. #
  3. # Usage: ./uig.sh PORT [--gdb]
  4. #
  5. # OPTIONS:
  6. # --gdb run under gdb
  7. #
  8. SCRIPT_DIR="$(dirname $(readlink -f "$0"))"
  9. UDFS_DIR="${SCRIPT_DIR}/../../essentials/udfs;${SCRIPT_DIR}/../../../ydb/library/yql/udfs"
  10. if [ -d "${SCRIPT_DIR}/../../udfs" ]; then
  11. UDFS_DIR="${UDFS_DIR};${SCRIPT_DIR}/../../udfs"
  12. fi
  13. if [ -d "${SCRIPT_DIR}/../../../../../yql/pg_ext" ]; then
  14. PG_EXT_OPT="--pg-ext pg_ext.txt"
  15. else
  16. PG_EXT_OPT=
  17. fi
  18. ASSETS_DIR=${SCRIPT_DIR}/http/www
  19. MOUNTS_CFG=${SCRIPT_DIR}/mounts.txt
  20. GATEWAYS_CFG=${SCRIPT_DIR}/../../essentials/cfg/tests/gateways.conf
  21. PORT=${1:-3000}
  22. if [ "$2" = "--gdb" ]; then
  23. GDB="yag tool gdb --args"
  24. fi
  25. if [ -z "${GITHUB_BUILD_DIR}" ]; then
  26. PGM=${SCRIPT_DIR}/yqlrun
  27. else
  28. PGM=${GITHUB_BUILD_DIR}/yql/tools/yqlrun/yqlrun
  29. fi
  30. ${GDB} ${PGM} ui \
  31. --mounts ${MOUNTS_CFG} \
  32. --udfs-dir ${UDFS_DIR} \
  33. --assets ${ASSETS_DIR} \
  34. --gateways-cfg ${GATEWAYS_CFG} \
  35. --remote --port $PORT \
  36. $PG_EXT_OPT