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

riptano/grafonnet-lib-dockerhub

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 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).

v1.0.4

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 61.1%
  • Jsonnet 24.5%
  • Shell 14.4%