runtime: Add make vendor

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 <fidencio@redhat.com>
This commit is contained in:
Fabiano Fidêncio 2021-07-13 14:05:35 +02:00
parent 930ca55d02
commit 579b3f34c2
2 changed files with 21 additions and 0 deletions

View File

@ -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) \

18
src/runtime/hack/tree_status.sh Executable file
View File

@ -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