From 55451d3c753ffade6c6c62c639350d02162d05d5 Mon Sep 17 00:00:00 2001 From: Madhur Batra Date: Sun, 21 Jun 2020 10:17:09 +0000 Subject: [PATCH] Add checks for dependencies that are not vendored. `make vendor` fails if any dependency is not vendored. Signed-off-by: Madhur Batra --- .dockerignore | 1 + .gitignore | 1 + Makefile | 3 ++- scripts/validate/check-all-packages-vendored | 12 ++++++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 scripts/validate/check-all-packages-vendored diff --git a/.dockerignore b/.dockerignore index f9fbc56056..1787a70c01 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,3 +4,4 @@ appveyor.yml build circle.yml +/vndr.log diff --git a/.gitignore b/.gitignore index 59cec00b21..a1f1bc9daf 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ cli/winresources/rsrc_amd64.syso /docs/yaml/gen/ coverage.txt profile.out +/vndr.log diff --git a/Makefile b/Makefile index 656cfb856d..96c6379c93 100644 --- a/Makefile +++ b/Makefile @@ -64,8 +64,9 @@ dynbinary: ## build dynamically linked binary vendor: vendor.conf ## check that vendor matches vendor.conf rm -rf vendor - bash -c 'vndr |& grep -v -i clone' + bash -c 'vndr |& grep -v -i clone | tee ./vndr.log' scripts/validate/check-git-diff vendor + scripts/validate/check-all-packages-vendored .PHONY: authors authors: ## generate AUTHORS file from git history diff --git a/scripts/validate/check-all-packages-vendored b/scripts/validate/check-all-packages-vendored new file mode 100755 index 0000000000..f884c1f58d --- /dev/null +++ b/scripts/validate/check-all-packages-vendored @@ -0,0 +1,12 @@ +#!/bin/sh + +set -eu + +WARN_MISS_VENDOR='WARNING: dependency is not vendored' + +if grep -q "$WARN_MISS_VENDOR" "./vndr.log"; then + echo + echo "Some dependencies are not vendored." + echo + exit 1 +fi