2020-03-13 08:34:25 -05:00
|
|
|
#!/bin/bash
|
2020-03-27 08:47:42 -05:00
|
|
|
set -eo pipefail
|
2020-03-13 08:34:25 -05:00
|
|
|
|
2022-01-20 11:01:00 -06:00
|
|
|
. scripts/grafana-server/variables
|
2020-03-13 08:34:25 -05:00
|
|
|
|
2020-05-03 06:51:30 -05:00
|
|
|
PORT=${PORT:-$DEFAULT_PORT}
|
2022-02-02 04:40:22 -06:00
|
|
|
ARCH=${ARCH:-$DEFAULT_ARCH}
|
|
|
|
|
|
|
|
if [ "$ARCH" ]; then
|
|
|
|
ARCH+="/"
|
|
|
|
fi
|
2020-05-03 06:51:30 -05:00
|
|
|
|
2022-01-20 11:01:00 -06:00
|
|
|
./scripts/grafana-server/kill-server
|
2020-03-13 08:34:25 -05:00
|
|
|
|
|
|
|
mkdir $RUNDIR
|
|
|
|
|
|
|
|
echo -e "Copying grafana backend files to temp dir..."
|
|
|
|
|
2022-02-02 04:40:22 -06:00
|
|
|
if [[ ! -f bin/"$ARCH"grafana-server ]]; then
|
|
|
|
echo "bin/linux-amd64/grafana-server missing, trying local grafana-server binary"
|
2020-03-13 08:34:25 -05:00
|
|
|
fi
|
|
|
|
|
2022-02-02 04:40:22 -06:00
|
|
|
echo starting server
|
|
|
|
|
|
|
|
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 ./scripts/grafana-server/custom.ini $RUNDIR/conf/custom.ini
|
|
|
|
cp ./conf/defaults.ini $RUNDIR/conf/defaults.ini
|
|
|
|
|
2020-03-13 08:34:25 -05:00
|
|
|
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"
|
|
|
|
|
2022-02-02 04:40:22 -06:00
|
|
|
$RUNDIR/bin/"$ARCH"grafana-server \
|
2021-11-01 04:53:33 -05:00
|
|
|
--homepath=$HOME_PATH \
|
2020-03-13 08:34:25 -05:00
|
|
|
--pidfile=$RUNDIR/pid \
|
|
|
|
cfg:server.http_port=$PORT \
|
2021-05-04 07:23:26 -05:00
|
|
|
cfg:server.router_logging=1 \
|
2023-01-26 15:04:13 -06:00
|
|
|
cfg:app_mode=development \
|
|
|
|
cfg:enterprise.license_path=$1
|
2020-03-13 08:34:25 -05:00
|
|
|
|
|
|
|
# 2>&1 > $RUNDIR/output.log &
|
|
|
|
# cfg:log.level=debug \
|
|
|
|
|