Skip to content

Commit

Permalink
mixin: Upgrade jsonnet tooling (thanos-io#3855)
Browse files Browse the repository at this point in the history
* Upgrade jsonnet tooling

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Fix bingo version issue

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Fix unintended removal issue

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
  • Loading branch information
kakkoyun authored and Andre Branchizio committed Mar 11, 2021
1 parent 06357fa commit 86b7572
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
20 changes: 13 additions & 7 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.3.0. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.3.1. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
GOPATH ?= $(shell go env GOPATH)
Expand Down Expand Up @@ -77,17 +77,23 @@ $(JB): $(BINGO_DIR)/jb.mod
@echo "(re)installing $(GOBIN)/jb-v0.4.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=jb.mod -o=$(GOBIN)/jb-v0.4.0 "github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb"

JSONNET := $(GOBIN)/jsonnet-v0.16.0
JSONNET_LINT := $(GOBIN)/jsonnet-lint-v0.17.1-0.20210113194615-cd59751527e0
$(JSONNET_LINT): $(BINGO_DIR)/jsonnet-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/jsonnet-lint-v0.17.1-0.20210113194615-cd59751527e0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=jsonnet-lint.mod -o=$(GOBIN)/jsonnet-lint-v0.17.1-0.20210113194615-cd59751527e0 "github.com/google/go-jsonnet/cmd/jsonnet-lint"

JSONNET := $(GOBIN)/jsonnet-v0.17.0
$(JSONNET): $(BINGO_DIR)/jsonnet.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/jsonnet-v0.16.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=jsonnet.mod -o=$(GOBIN)/jsonnet-v0.16.0 "github.com/google/go-jsonnet/cmd/jsonnet"
@echo "(re)installing $(GOBIN)/jsonnet-v0.17.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=jsonnet.mod -o=$(GOBIN)/jsonnet-v0.17.0 "github.com/google/go-jsonnet/cmd/jsonnet"

JSONNETFMT := $(GOBIN)/jsonnetfmt-v0.16.0
JSONNETFMT := $(GOBIN)/jsonnetfmt-v0.17.0
$(JSONNETFMT): $(BINGO_DIR)/jsonnetfmt.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/jsonnetfmt-v0.16.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=jsonnetfmt.mod -o=$(GOBIN)/jsonnetfmt-v0.16.0 "github.com/google/go-jsonnet/cmd/jsonnetfmt"
@echo "(re)installing $(GOBIN)/jsonnetfmt-v0.17.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=jsonnetfmt.mod -o=$(GOBIN)/jsonnetfmt-v0.17.0 "github.com/google/go-jsonnet/cmd/jsonnetfmt"

MINIO := $(GOBIN)/minio-v0.0.0-20200527010300-cccf2de129da
$(MINIO): $(BINGO_DIR)/minio.mod
Expand Down
5 changes: 5 additions & 0 deletions .bingo/jsonnet-lint.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.16

require github.com/google/go-jsonnet v0.17.1-0.20210113194615-cd59751527e0 // cmd/jsonnet-lint
2 changes: 1 addition & 1 deletion .bingo/jsonnet.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.14

require github.com/google/go-jsonnet v0.16.0 // cmd/jsonnet
require github.com/google/go-jsonnet v0.17.0 // cmd/jsonnet
2 changes: 1 addition & 1 deletion .bingo/jsonnetfmt.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.14

require github.com/google/go-jsonnet v0.16.0 // cmd/jsonnetfmt
require github.com/google/go-jsonnet v0.17.0 // cmd/jsonnetfmt
8 changes: 5 additions & 3 deletions .bingo/variables.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.3.0. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.3.1. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk.
GOBIN=${GOBIN:=$(go env GOBIN)}
Expand Down Expand Up @@ -28,9 +28,11 @@ HUGO="${GOBIN}/hugo-v0.80.0"

JB="${GOBIN}/jb-v0.4.0"

JSONNET="${GOBIN}/jsonnet-v0.16.0"
JSONNET_LINT="${GOBIN}/jsonnet-lint-v0.17.1-0.20210113194615-cd59751527e0"

JSONNETFMT="${GOBIN}/jsonnetfmt-v0.16.0"
JSONNET="${GOBIN}/jsonnet-v0.17.0"

JSONNETFMT="${GOBIN}/jsonnetfmt-v0.17.0"

MINIO="${GOBIN}/minio-v0.0.0-20200527010300-cccf2de129da"

Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ jsonnet-format: $(JSONNETFMT)
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
xargs -n 1 -- $(JSONNETFMT_CMD) -i

.PHONY: jsonnet-lint
jsonnet-lint: $(JSONNET_LINT) ${JSONNET_VENDOR_DIR}
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
xargs -n 1 -- $(JSONNET_LINT) -J ${JSONNET_VENDOR_DIR}

.PHONY: example-rules-lint
example-rules-lint: $(PROMTOOL) examples/alerts/alerts.yaml examples/alerts/rules.yaml
$(PROMTOOL) check rules examples/alerts/alerts.yaml examples/alerts/rules.yaml
Expand Down

0 comments on commit 86b7572

Please sign in to comment.