2021-09-28 14:02:33 +00:00
|
|
|
#!/bin/bash -ex
|
|
|
|
|
2021-09-29 14:33:33 +00:00
|
|
|
which jsonnet > /dev/null || { echo "Required jsonnet not found!"; exit 1;}
|
|
|
|
which jb > /dev/null || { echo "Required jb ( json-bundler ) not found!"; exit 1;}
|
2021-09-28 14:02:33 +00:00
|
|
|
|
2021-09-29 14:33:33 +00:00
|
|
|
# wget https://github.com/jsonnet-bundler/jsonnet-bundler/releases/download/v0.4.0/jb-linux-amd64
|
2021-09-28 14:02:33 +00:00
|
|
|
|
2021-09-29 14:33:33 +00:00
|
|
|
[ -r jsonnetfile.json ] || jb init
|
2021-09-28 14:02:33 +00:00
|
|
|
if [ -r jsonnetfile.lock.json ]; then
|
2021-09-29 14:33:33 +00:00
|
|
|
jb update
|
2021-09-28 14:02:33 +00:00
|
|
|
else
|
2022-01-28 16:19:41 +00:00
|
|
|
#jb install github.com/prometheus-operator/kube-prometheus/jsonnet/kube-prometheus@main
|
|
|
|
jb install github.com/prometheus-operator/kube-prometheus/jsonnet/kube-prometheus@release-0.9
|
2021-09-28 14:02:33 +00:00
|
|
|
fi
|
|
|
|
|
2022-04-08 15:08:28 +00:00
|
|
|
make clean
|
|
|
|
jsonnet -J vendor -m dashboards -e '(import "dashboards.libsonnet").grafanaDashboards'
|
2021-09-28 14:02:33 +00:00
|
|
|
|
|
|
|
#jsonnet -J vendor -m rules rules.libsonnet | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml' -- {}
|
|
|
|
jsonnet -J vendor -m rules rules.libsonnet
|