Skip to content

Commit

Permalink
fix grafana plugin install version (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
linuzb authored Apr 29, 2024
1 parent 856b49f commit 2844035
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
DOCKERHUB_LUNETTES_REPO: lunettes/lunettes
DOCKERHUB_GRAFANA_REPO: lunettes/grafana
# Plugins to be installed.
GRAFANA_PLUGINS: yesoreyeram-infinity-datasource,marcusolsson-json-datasource,marcusolsson-dynamictext-panel,volkovlabs-form-panel 3.1.0
GRAFANA_PLUGINS: "yesoreyeram-infinity-datasource,marcusolsson-json-datasource,marcusolsson-dynamictext-panel,volkovlabs-form-panel:3.1.0"


jobs:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ jobs:
# Generate two Docker tags: ${APP_VERSION}
tags: |
${{ env.LUNETTES_DOCKERHUB_REPO }}:${{ env.APP_VERSION }}
- name: Test Build grafana
id: docker_build_grafana
uses: docker/build-push-action@v2
with:
push: false
file: build/docker/Dockerfile.grafana
# docker build arg
build-args: |
GRAFANA_PLUGINS="yesoreyeram-infinity-datasource,marcusolsson-json-datasource,marcusolsson-dynamictext-panel,volkovlabs-form-panel:3.1.0"
tags: |
grafana:${{ env.APP_VERSION }}
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
Expand Down
20 changes: 16 additions & 4 deletions build/docker/Dockerfile.grafana
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,28 @@ WORKDIR /app/yaml_panel
# 安装依赖并编译
RUN npm install \
&& npm run build

# Use the official Grafana image as the base image.
FROM grafana/grafana:latest
FROM grafana/grafana:10.4.2-ubuntu

COPY --from=node /app/yaml_panel/dist /var/lib/grafana/plugins/antgroup-yaml-panel

# Define the list of plugins to install, separated by spaces.
ARG PLUGINS=""

# Install each plugin.
ARG IFS=','
RUN for plugin in $PLUGINS; do \
RUN set -e; \
ORIG_IFS=${IFS}; \
IFS=','; \
for plugin in $PLUGINS; do \
if echo "$plugin" | grep -q ':'; then \
plugin_name=$(echo $plugin | cut -d ':' -f1); \
plugin_version=$(echo $plugin | cut -d ':' -f2); \
echo "Installing plugin $plugin_name version $plugin_version"; \
grafana-cli plugins install $plugin_name $plugin_version; \
else \
echo "Installing plugin $plugin"; \
grafana-cli plugins install $plugin; \
done
fi \
done; \
IFS=${ORIG_IFS};

0 comments on commit 2844035

Please sign in to comment.