Bläddra i källkod

docker: makes it possible to set a specific plugin url.

Originally from the grafana/grafana-docker repo, authored
by @ClementGautier.
Leonard Gram 7 år sedan
förälder
incheckning
48713b76f3
1 ändrade filer med 7 tillägg och 1 borttagningar
  1. 7 1
      packaging/docker/run.sh

+ 7 - 1
packaging/docker/run.sh

@@ -67,7 +67,13 @@ if [ ! -z "${GF_INSTALL_PLUGINS}" ]; then
   IFS=','
   for plugin in ${GF_INSTALL_PLUGINS}; do
     IFS=$OLDIFS
-    grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}
+    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}
+    else
+        grafana-cli --pluginsDir "${GF_PATHS_PLUGINS}" plugins install ${plugin}
+    fi
   done
 fi