Skip to content

Commit

Permalink
Grafana image renderer (#34751)
Browse files Browse the repository at this point in the history
Signed-off-by: kz3640 <[email protected]>
  • Loading branch information
kz3640 authored Nov 22, 2024
1 parent aec2246 commit 9c504fd
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions grafana-image-renderer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package:
name: grafana-image-renderer
version: 3.11.6
epoch: 0
description: A Grafana backend plugin that handles rendering of panels & dashboards to PNGs using headless browser (Chromium/Chrome)
copyright:
- license: Apache-2.0
target-architecture:
- x86_64
dependencies:
runtime:
- chromium
- dumb-init
- nodejs

environment:
contents:
packages:
- build-base
- busybox
- ca-certificates-bundle
- nodejs
- scanelf
- ttf-dejavu
- vim
- yarn

pipeline:
- uses: git-checkout
with:
repository: https://github.com/grafana/grafana-image-renderer
tag: v${{package.version}}
expected-commit: 61d808662b646f9fd1ec322ada2cb7acc20f706a

- runs: |
# Bump CVE-2024-21538
yarn add cross-spawn@^7.0.5
yarn upgrade
yarn build
yarn install --production
# Node module installs multi-arch libraries, this deletes them
scanelf -R -n . | awk '/aarch64/ {print $NF}' | xargs rm -rf
mkdir -p ${{targets.destdir}}/usr/src/app/
cp -r ./proto ${{targets.destdir}}/usr/src/app/
cp -r ./build ${{targets.destdir}}/usr/src/app/
cp -r ./node_modules ${{targets.destdir}}/usr/src/app/
cp ./devenv/docker/custom-config/config.json ${{targets.destdir}}/usr/src/app/
cp ./plugin.json ${{targets.destdir}}/usr/src/app/
update:
enabled: true
github:
identifier: grafana/grafana-image-renderer
strip-prefix: v

test:
pipeline:
- name: "start app"
working-directory: /usr/src/app
uses: test/daemon-check-output
with:
start: "env CHROME_BIN=/usr/bin/chromium-browser dumb-init -- node build/app.js server --config=config.json"
timeout: 5
expected_output: |
{"level":"info","message":"HTTP Server started, listening at http://localhost:8081"}

0 comments on commit 9c504fd

Please sign in to comment.