diff --git a/grafana-image-renderer.yaml b/grafana-image-renderer.yaml new file mode 100644 index 00000000000..faf448568cd --- /dev/null +++ b/grafana-image-renderer.yaml @@ -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"}