From 6958340b245b3155301b77a9983fe827129fe853 Mon Sep 17 00:00:00 2001 From: Will Browne Date: Tue, 27 Apr 2021 16:30:59 +0200 Subject: [PATCH] Plugins: Support installing to folders with whitespace and fix pluginUrl trailing and leading whitespace failures (#32506) * Plugins: Support installing to folders with whitespace and fix pluginUrl trailing and leading whitespace failures * update docs * update docs --- docs/sources/installation/docker.md | 6 +++--- packaging/docker/custom/Dockerfile | 4 ++-- packaging/docker/custom/ubuntu.Dockerfile | 4 ++-- packaging/docker/run.sh | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/sources/installation/docker.md b/docs/sources/installation/docker.md index a721500937f..fb399d68183 100755 --- a/docs/sources/installation/docker.md +++ b/docs/sources/installation/docker.md @@ -81,13 +81,13 @@ docker run -d \ > Only available in Grafana v5.3.1 and later. -You can install plugins from custom URLs by specifying the URL like this: `GF_INSTALL_PLUGINS=;`. +You can install a plugin from a custom URL by specifying the URL like this: `GF_INSTALL_PLUGINS=;`. ```bash docker run -d \ -p 3000:3000 \ --name=grafana \ - -e "GF_INSTALL_PLUGINS=http://plugin-domain.com/my-custom-plugin.zip;custom-plugin" \ + -e "GF_INSTALL_PLUGINS=http://plugin-domain.com/my-custom-plugin.zip;custom-plugin,grafana-clock-panel" \ grafana/grafana ``` @@ -114,7 +114,7 @@ docker run -d -p 3000:3000 --name=grafana grafana-custom ### Build with pre-installed plugins from other sources -You can build a Docker image with plugins from other sources by specifying the URL like this: `GF_INSTALL_PLUGINS=;`. +You can build a Docker image with plugins from other sources by specifying the URL like this: `GF_INSTALL_PLUGINS=;`. ```bash cd packaging/docker/custom diff --git a/packaging/docker/custom/Dockerfile b/packaging/docker/custom/Dockerfile index e595447e9c6..dc240a1619e 100644 --- a/packaging/docker/custom/Dockerfile +++ b/packaging/docker/custom/Dockerfile @@ -42,8 +42,8 @@ RUN if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then \ IFS=$OLDIFS; \ if expr match "$plugin" '.*\;.*'; then \ pluginUrl=$(echo "$plugin" | cut -d';' -f 1); \ - pluginWithoutUrl=$(echo "$plugin" | cut -d';' -f 2); \ - grafana-cli --pluginUrl "${pluginUrl}" --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${pluginWithoutUrl}; \ + pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2); \ + grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}"; \ else \ grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}; \ fi \ diff --git a/packaging/docker/custom/ubuntu.Dockerfile b/packaging/docker/custom/ubuntu.Dockerfile index ec3e82d6a4a..392d0227f3a 100644 --- a/packaging/docker/custom/ubuntu.Dockerfile +++ b/packaging/docker/custom/ubuntu.Dockerfile @@ -46,8 +46,8 @@ RUN if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then \ IFS=$OLDIFS; \ if expr match "$plugin" '.*\;.*'; then \ pluginUrl=$(echo "$plugin" | cut -d';' -f 1); \ - pluginWithoutUrl=$(echo "$plugin" | cut -d';' -f 2); \ - grafana-cli --pluginUrl "${pluginUrl}" --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${pluginWithoutUrl}; \ + pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2); \ + grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}"; \ else \ grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}; \ fi \ diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh index cad15d19a73..30a70759616 100755 --- a/packaging/docker/run.sh +++ b/packaging/docker/run.sh @@ -69,8 +69,8 @@ if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then IFS=$OLDIFS if [[ $plugin =~ .*\;.* ]]; then pluginUrl=$(echo "$plugin" | cut -d';' -f 1) - pluginWithoutUrl=$(echo "$plugin" | cut -d';' -f 2) - grafana-cli --pluginUrl "${pluginUrl}" --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${pluginWithoutUrl} + pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2) + grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}" else grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin} fi