aboutsummaryrefslogtreecommitdiffstats
path: root/yql/tools/yqlrun/uig.sh
blob: dfe4e7012efaedd8457c3ba3b34abd6dadb84f3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh -e

#
# Usage: ./uig.sh PORT [--gdb]
#
# OPTIONS:
#     --gdb   run under gdb
#

SCRIPT_DIR="$(dirname $(readlink -f "$0"))"

UDFS_DIR="${SCRIPT_DIR}/../../essentials/udfs;${SCRIPT_DIR}/../../../ydb/library/yql/udfs"
if [ -d "${SCRIPT_DIR}/../../udfs" ]; then
UDFS_DIR="${UDFS_DIR};${SCRIPT_DIR}/../../udfs"
fi
if [ -d "${SCRIPT_DIR}/../../../../../yql/pg_ext" ]; then
PG_EXT_OPT="--pg-ext pg_ext.txt"
else
PG_EXT_OPT=
fi

ASSETS_DIR=${SCRIPT_DIR}/http/www
MOUNTS_CFG=${SCRIPT_DIR}/mounts.txt
GATEWAYS_CFG=${SCRIPT_DIR}/../../essentials/cfg/tests/gateways.conf

PORT=${1:-3000}

if [ "$2" = "--gdb" ]; then
    GDB="yag tool gdb --args"
fi

if [ -z "${GITHUB_BUILD_DIR}" ]; then
    PGM=${SCRIPT_DIR}/yqlrun
else
    PGM=${GITHUB_BUILD_DIR}/yql/tools/yqlrun/yqlrun
fi

${GDB} ${PGM} ui \
    --mounts ${MOUNTS_CFG} \
    --udfs-dir ${UDFS_DIR} \
    --assets ${ASSETS_DIR} \
    --gateways-cfg ${GATEWAYS_CFG} \
    --remote --port $PORT \
    $PG_EXT_OPT