diff --git a/Makefile b/Makefile index 994fa5ae6b2eb2853837d3127108458385750e21..e4f52e164182f1be90af765f0888a7f985f2e441 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/go.mod b/go.mod index 2be821b6b9c1168649ed4ac38d7687ae148e2370..54580a41b3c2e94decb9b84f544335a99d67cf0f 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d // indirect github.com/imdario/mergo v0.3.7 // indirect github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be // indirect - github.com/jsonnet-bundler/jsonnet-bundler v0.1.0 // indirect + github.com/jsonnet-bundler/jsonnet-bundler v0.2.0 // indirect github.com/mattn/go-colorable v0.1.4 // indirect github.com/mattn/go-isatty v0.0.10 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect diff --git a/go.sum b/go.sum index a53919d64d6224677aefdde86e1a3a89d7d583e9..0ef1dd6c46e89cf54b1cc9272abfc4c96e86897c 100644 --- a/go.sum +++ b/go.sum @@ -27,6 +27,8 @@ github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be h1:AHimNtVIpiBjPU github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jsonnet-bundler/jsonnet-bundler v0.1.0 h1:T/HtHFr+mYCRULrH1x/RnoB0prIs0rMkolJhFMXNC9A= github.com/jsonnet-bundler/jsonnet-bundler v0.1.0/go.mod h1:YKsSFc9VFhhLITkJS3X2PrRqWG9u2Jq99udTdDjQLfM= +github.com/jsonnet-bundler/jsonnet-bundler v0.2.0 h1:qL1v+2mjdEOmvNJp+ab+wQH81TQY71w1A666CRUg+1U= +github.com/jsonnet-bundler/jsonnet-bundler v0.2.0/go.mod h1:/by7P/OoohkI3q4CgSFqcoFsVY+IaNbzOVDknEsKDeU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -66,6 +68,7 @@ golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e h1:nFYrTHrdrAOpShe27kaFHjsqYSEQ0KWqdWLu3xuZJts= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191023151326-f89234f9a2c2 h1:I7efaDQAsIQmkTF+WSdcydwVWzK07Yuz8IFF8rNkDe0= golang.org/x/sys v0.0.0-20191023151326-f89234f9a2c2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU= diff --git a/scripts/tools.go b/scripts/tools.go new file mode 100644 index 0000000000000000000000000000000000000000..9cd7218bcecaf78ad1e30219f6d99d1652a8299d --- /dev/null +++ b/scripts/tools.go @@ -0,0 +1,9 @@ +//+build tools + +// Package tools tracks dependencies for tools that used in the build process. +// See https://github.com/golang/go/wiki/Modules +package tools + +import ( + _ "github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb" +)