mirror of
https://github.com/grafana/grafana.git
synced 2024-11-24 09:50:29 -06:00
de99ce139c
* avoid the need for a second bulky binary for grafana-cli * look for grafana-server in $PATH as well as same directory * implement unified "grafana" command * update dockerfiles, fix grafana-cli -v * update packaging to work with single binary - add wrapper scripts for grafana and grafana-server - update and sync package files - implement --sign flag of build package command - stop packaging scripts folder, they are not useful for end users - add support for --configOverrides in server command - remove unused nfpm.yaml config file * windows support
43 lines
1.1 KiB
Bash
Executable File
43 lines
1.1 KiB
Bash
Executable File
#! /usr/bin/env bash
|
|
|
|
# Wrapper for the grafana binary
|
|
# This file serves as a wrapper for the grafana binary. It ensures we set
|
|
# the system-wide Grafana configuration that was bundled with the package as we
|
|
# use the binary.
|
|
|
|
DEFAULT=/etc/default/grafana
|
|
|
|
GRAFANA_HOME="${GRAFANA_HOME:-/usr/share/grafana}"
|
|
|
|
CONF_DIR=/etc/grafana
|
|
DATA_DIR=/var/lib/grafana
|
|
PLUGINS_DIR=/var/lib/grafana/plugins
|
|
LOG_DIR=/var/log/grafana
|
|
|
|
CONF_FILE=$CONF_DIR/grafana.ini
|
|
PROVISIONING_CFG_DIR=$CONF_DIR/provisioning
|
|
|
|
EXECUTABLE="$GRAFANA_HOME/bin/grafana"
|
|
|
|
if [ ! -x $EXECUTABLE ]; then
|
|
echo "$EXECUTABLE not installed or not executable"
|
|
exit 5
|
|
fi
|
|
|
|
# overwrite settings from default file
|
|
if [ -f "$DEFAULT" ]; then
|
|
. "$DEFAULT"
|
|
fi
|
|
|
|
OPTS="--homepath=${GRAFANA_HOME} \
|
|
--config=${CONF_FILE} \
|
|
--pluginsDir=${PLUGINS_DIR} \
|
|
--configOverrides='cfg:default.paths.provisioning=$PROVISIONING_CFG_DIR \
|
|
cfg:default.paths.data=${DATA_DIR} \
|
|
cfg:default.paths.logs=${LOG_DIR} \
|
|
cfg:default.paths.plugins=${PLUGINS_DIR}'"
|
|
|
|
CMD=cli
|
|
|
|
eval $EXECUTABLE "$CMD" "$OPTS" "$@"
|