From 579b3f34c2d2695c3595441e522c9d0412b8e29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 13 Jul 2021 14:05:35 +0200 Subject: [PATCH] runtime: Add `make vendor` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's add this target so we can actually enforce, as part of the static checks (which will be added in a follow-up commit), that our vendored go code is up-to-date. Related: #2159 Signed-off-by: Fabiano FidĂȘncio --- src/runtime/Makefile | 3 +++ src/runtime/hack/tree_status.sh | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100755 src/runtime/hack/tree_status.sh diff --git a/src/runtime/Makefile b/src/runtime/Makefile index 52c876bd48..479c08b5d7 100644 --- a/src/runtime/Makefile +++ b/src/runtime/Makefile @@ -653,6 +653,9 @@ handle_vendor: go mod vendor go mod verify +vendor: handle_vendor + ./hack/tree_status.sh + clean: $(QUIET_CLEAN)rm -f \ $(CONFIGS) \ diff --git a/src/runtime/hack/tree_status.sh b/src/runtime/hack/tree_status.sh new file mode 100755 index 0000000000..4827107746 --- /dev/null +++ b/src/runtime/hack/tree_status.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# Copyright 2021 Red Hat Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# +set -e + +STATUS=$(git status --porcelain) +if [[ -z $STATUS ]]; then + echo "tree is clean" +else + echo "tree is dirty, please commit all changes" + echo "" + echo "$STATUS" + git diff + exit 1 +fi