Skip to content

A simple Docker image that has jsonnet and grafana's grafonnet lib for CI/CD purposes

Notifications You must be signed in to change notification settings

AndrewFarley/grafonnet-lib-dockerhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Grafonnet Lib Docker Image

A simple Docker image that has jsonnet and grafana's grafonnet lib for CI/CD purposes, or to avoid having to install jsonnet and grafonnet on your computer (keep it in docker).

Sample Usage

If you have a single dashboard called generateme.jsonnet in the current folder to compile you can...

docker run -v `pwd`:/here andrewfarley/jsonnet-bundler-grafonnet-lib:latest jsonnet /here/generateme.jsonnet

Or to send it to a file...

docker run -v `pwd`:/here andrewfarley/jsonnet-bundler-grafonnet-lib:latest jsonnet /here/generateme.jsonnet > generateme-output.json

If you have a folder full of dashboards in the folder dashboards-jsonnet to compile you can...

mkdir generated-dashboards
for file in dashboards-jsonnet/*; do name=$(basename $file); docker run -v `pwd`:/here andrewfarley/jsonnet-bundler-grafonnet-lib:latest jsonnet /here/$file > generated-dashboards/${name%.jsonnet}.json; done

Or if you want to build from within' a CI/CD builder (eg: Gitlab) here is a sample Gitlab-CI job....

created-dashboards:
  stage: build-artifacts
  image: "andrewfarley/jsonnet-bundler-grafonnet-lib:latest"
  script:
    - mkdir generated-dashboards
    - for file in dashboards-jsonnet/*; do name=$(basename $file); jsonnet $file > generated-dashboards/${name%.jsonnet}.json; done
  artifacts:
    paths: ['generated-dashboards']

Relevant Links

Attribution

Original Dockerfile Author: https://github.com/mlushpenko

About

A simple Docker image that has jsonnet and grafana's grafonnet lib for CI/CD purposes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published