From 315084fa15ffbecd69739a64554c79a468c2d337 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 8 Jan 2018 19:01:13 -0500 Subject: [PATCH] Add a vendor check to CI Signed-off-by: Daniel Nephin --- .travis.yml | 1 + script/validate/vendor | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 script/validate/vendor diff --git a/.travis.yml b/.travis.yml index 70dce7956..812ea22ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,7 @@ script: - export CGO_ENABLED=$TRAVIS_CGO_ENABLED - DCO_VERBOSITY=-q script/validate/dco - GOOS=linux script/setup/install-dev-tools + - script/validate/vendor - go build -i . - make check - if [ "$GOOS" = "linux" ]; then make check-protos check-api-descriptors; fi diff --git a/script/validate/vendor b/script/validate/vendor new file mode 100755 index 000000000..458a65c0a --- /dev/null +++ b/script/validate/vendor @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -eu -o pipefail + +vndr 2>&1 | grep -v -i clone + +DIFF_PATH="vendor/" +DIFF=$(git status --porcelain -- "$DIFF_PATH") + +if [ "$DIFF" ]; then + echo + echo "These files were modified:" + echo + echo "$DIFF" + echo + exit 1 +else + echo "$DIFF_PATH is correct" +fi