grafana/e2e/start-server
Artur Wierzbicki e01ac44cfa
Live: performance tests e2e part (#43915)
* #41993: live perf tests e2e part

* #41993: added bash upgrade instructions

* #41993: remove custom feature toggle

* #41993: fix typo in 'integrationFolder'
2022-01-12 22:15:29 +04:00

62 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -eo pipefail
. e2e/variables
PORT=${PORT:-$DEFAULT_PORT}
PACKAGE_FILE=${PACKAGE_FILE:-$DEFAULT_PACKAGE_FILE}
./e2e/kill-server
mkdir $RUNDIR
echo -e "Copying grafana backend files to temp dir..."
# Expand any wildcards
pkgs=(${PACKAGE_FILE})
pkg=${pkgs[0]}
if [[ -f ${pkg} ]]; then
echo "Found package tar file ${pkg}, extracting..."
tar zxf ${pkg} -C $RUNDIR
mv $RUNDIR/grafana-*/* $RUNDIR
else
echo "Couldn't find package ${PACKAGE_FILE} - copying local dev files"
if [[ ! -f bin/grafana-server ]]; then
echo bin/grafana-server missing
exit 1
fi
cp -r ./bin $RUNDIR
cp -r ./public $RUNDIR
cp -r ./tools $RUNDIR
mkdir $RUNDIR/conf
mkdir $PROV_DIR
mkdir $PROV_DIR/datasources
mkdir $PROV_DIR/dashboards
cp ./e2e/custom.ini $RUNDIR/conf/custom.ini
cp ./conf/defaults.ini $RUNDIR/conf/defaults.ini
fi
echo -e "Copy provisioning setup from devenv"
cp devenv/datasources.yaml $PROV_DIR/datasources
cp devenv/dashboards.yaml $PROV_DIR/dashboards
cp -r devenv $RUNDIR
echo -e "Starting Grafana Server port $PORT"
$RUNDIR/bin/grafana-server \
--homepath=$HOME_PATH \
--pidfile=$RUNDIR/pid \
cfg:server.http_port=$PORT \
cfg:server.router_logging=1 \
cfg:app_mode=development
# 2>&1 > $RUNDIR/output.log &
# cfg:log.level=debug \