generate jsonnet-bundler binary if it's not available

Also locks jsonnet-bundler to version v0.2.0
This commit is contained in:
Paul Gier
2020-02-05 16:37:18 -06:00
parent 5774353d24
commit 37c8d369ee
4 changed files with 20 additions and 4 deletions

View File

@@ -7,7 +7,8 @@ else
endif
JSONNET_FMT := $(JSONNET_FMT_CMD) $(JSONNET_FMT_ARGS)
JB_BINARY := jb
FIRST_GOPATH:=$(firstword $(subst :, ,$(shell go env GOPATH)))
JB_BINARY:=$(FIRST_GOPATH)/bin/jb
EMBEDMD_BINARY := embedmd
CONTAINER_CMD:=docker run --rm \
-e http_proxy -e https_proxy -e no_proxy \
@@ -38,7 +39,7 @@ manifests: examples/kustomize.jsonnet vendor build.sh
rm -rf manifests
./build.sh $<
vendor: jsonnetfile.json jsonnetfile.lock.json
vendor: $(JB_BINARY) jsonnetfile.json jsonnetfile.lock.json
rm -rf vendor
$(JB_BINARY) install
@@ -46,7 +47,7 @@ fmt:
find . -name 'vendor' -prune -o -name '*.libsonnet' -o -name '*.jsonnet' -print | \
xargs -n 1 -- $(JSONNET_FMT) -i
test:
test: $(JB_BINARY)
$(JB_BINARY) install
./test.sh
@@ -58,3 +59,6 @@ test-in-docker:
$(CONTAINER_CMD) make $(MFLAGS) test
.PHONY: generate generate-in-docker test test-in-docker fmt
$(JB_BINARY):
go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb