generate jsonnet-bundler binary if it's not available
Also locks jsonnet-bundler to version v0.2.0
This commit is contained in:
10
Makefile
10
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
|
||||
|
||||
2
go.mod
2
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
|
||||
|
||||
3
go.sum
3
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=
|
||||
|
||||
9
scripts/tools.go
Normal file
9
scripts/tools.go
Normal file
@@ -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"
|
||||
)
|
||||
Reference in New Issue
Block a user