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
This commit is contained in:
Will Browne 2021-04-27 16:30:59 +02:00 committed by GitHub
parent e6f9f65fdf
commit 6958340b24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -81,13 +81,13 @@ docker run -d \
> Only available in Grafana v5.3.1 and later. > 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=<url to plugin zip>;<plugin name>`. You can install a plugin from a custom URL by specifying the URL like this: `GF_INSTALL_PLUGINS=<url to plugin zip>;<plugin install folder name>`.
```bash ```bash
docker run -d \ docker run -d \
-p 3000:3000 \ -p 3000:3000 \
--name=grafana \ --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 grafana/grafana
``` ```
@ -114,7 +114,7 @@ docker run -d -p 3000:3000 --name=grafana grafana-custom
### Build with pre-installed plugins from other sources ### 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=<url to plugin zip>;<plugin name>`. You can build a Docker image with plugins from other sources by specifying the URL like this: `GF_INSTALL_PLUGINS=<url to plugin zip>;<plugin install folder name>`.
```bash ```bash
cd packaging/docker/custom cd packaging/docker/custom

View File

@ -42,8 +42,8 @@ RUN if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then \
IFS=$OLDIFS; \ IFS=$OLDIFS; \
if expr match "$plugin" '.*\;.*'; then \ if expr match "$plugin" '.*\;.*'; then \
pluginUrl=$(echo "$plugin" | cut -d';' -f 1); \ pluginUrl=$(echo "$plugin" | cut -d';' -f 1); \
pluginWithoutUrl=$(echo "$plugin" | cut -d';' -f 2); \ pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2); \
grafana-cli --pluginUrl "${pluginUrl}" --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${pluginWithoutUrl}; \ grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}"; \
else \ else \
grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}; \ grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}; \
fi \ fi \

View File

@ -46,8 +46,8 @@ RUN if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then \
IFS=$OLDIFS; \ IFS=$OLDIFS; \
if expr match "$plugin" '.*\;.*'; then \ if expr match "$plugin" '.*\;.*'; then \
pluginUrl=$(echo "$plugin" | cut -d';' -f 1); \ pluginUrl=$(echo "$plugin" | cut -d';' -f 1); \
pluginWithoutUrl=$(echo "$plugin" | cut -d';' -f 2); \ pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2); \
grafana-cli --pluginUrl "${pluginUrl}" --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${pluginWithoutUrl}; \ grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}"; \
else \ else \
grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}; \ grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}; \
fi \ fi \

View File

@ -69,8 +69,8 @@ if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then
IFS=$OLDIFS IFS=$OLDIFS
if [[ $plugin =~ .*\;.* ]]; then if [[ $plugin =~ .*\;.* ]]; then
pluginUrl=$(echo "$plugin" | cut -d';' -f 1) pluginUrl=$(echo "$plugin" | cut -d';' -f 1)
pluginWithoutUrl=$(echo "$plugin" | cut -d';' -f 2) pluginInstallFolder=$(echo "$plugin" | cut -d';' -f 2)
grafana-cli --pluginUrl "${pluginUrl}" --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${pluginWithoutUrl} grafana-cli --pluginUrl ${pluginUrl} --pluginsDir "${GF_PATHS_PLUGINS}" plugins install "${pluginInstallFolder}"
else else
grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin} grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}
fi fi