Add formatting jsonnet to generate make target

This commit is contained in:
Frederic Branczyk
2018-05-18 12:04:33 +02:00
parent d8f6b6f81b
commit ca057722e5
6 changed files with 38 additions and 32 deletions

View File

@@ -1,3 +1,5 @@
JSONNET_FMT := jsonnet fmt -n 2 --max-blank-lines 2 --string-style s --comment-style s
image:
docker build -f ../../scripts/jsonnet/Dockerfile -t po-jsonnet ../../
@@ -11,10 +13,14 @@ crdtojsonnet:
cat ../../example/prometheus-operator-crd/servicemonitor.crd.yaml | gojsontoyaml -yamltojson > jsonnet/kube-prometheus/prometheus-operator/servicemonitor-crd.libsonnet
cat ../../example/prometheus-operator-crd/rulefile.crd.yaml | gojsontoyaml -yamltojson > jsonnet/kube-prometheus/prometheus-operator/rulefile-crd.libsonnet
generate-raw: crdtojsonnet
generate-raw: crdtojsonnet fmt
jb install
./build.sh
fmt:
find . -name 'vendor' -prune -o -name '*.libsonnet' -o -name '*.jsonnet' -print | \
xargs -n 1 -- $(JSONNET_FMT) -i
test: image
@echo ">> Compiling assets and generating Kubernetes manifests"
docker run --rm -u=$(shell id -u $(USER)):$(shell id -g $(USER)) -v $(shell dirname $(dir $(abspath $(dir $$PWD)))):/go/src/github.com/coreos/prometheus-operator/ --workdir /go/src/github.com/coreos/prometheus-operator/contrib/kube-prometheus po-jsonnet make test-raw
@@ -23,4 +29,4 @@ test-raw: crdtojsonnet
jb install
./test.sh
.PHONY: image generate crdtojsonnet generate-raw test
.PHONY: image generate crdtojsonnet generate-raw test test-raw fmt