makefile: update Makefile.common with newer version (#627)
authorPrometheusBot <prometheus-team@googlegroups.com>
Tue, 19 May 2020 08:23:22 +0000 (11:23 +0300)
committerGitHub <noreply@github.com>
Tue, 19 May 2020 08:23:22 +0000 (09:23 +0100)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
Makefile.common

index b978dfc50d2f32603e8e7e09a18baba6ccf98cf5..9320176ca24f423b5e90adb69df97c6829495c7d 100644 (file)
@@ -150,6 +150,17 @@ else
        $(GO) get $(GOOPTS) -t ./...
 endif
 
+.PHONY: update-go-deps
+update-go-deps:
+       @echo ">> updating Go dependencies"
+       @for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
+               $(GO) get $$m; \
+       done
+       GO111MODULE=$(GO111MODULE) $(GO) mod tidy
+ifneq (,$(wildcard vendor))
+       GO111MODULE=$(GO111MODULE) $(GO) mod vendor
+endif
+
 .PHONY: common-test-short
 common-test-short: $(GOTEST_DIR)
        @echo ">> running short tests"