diff --git a/common/.cirrus.yml b/common/.cirrus.yml index 0ab0f35b27..2948e5dc75 100644 --- a/common/.cirrus.yml +++ b/common/.cirrus.yml @@ -52,6 +52,7 @@ testing_task: - export PATH="$PATH:$GOPATH/bin" - gpg --batch --passphrase '' --quick-gen-key tester@localhost default default never - make vendor + - hack/tree_status.sh - make build - make build-cross - make test diff --git a/common/hack/tree_status.sh b/common/hack/tree_status.sh new file mode 100755 index 0000000000..8c9c2abe8f --- /dev/null +++ b/common/hack/tree_status.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -e + +SUGGESTION="${SUGGESTION:-run \"make vendor\" and commit all changes.}" + +STATUS=$(git status --porcelain) +if [[ -z $STATUS ]] +then + echo "tree is clean" +else + echo "tree is dirty, please $SUGGESTION" + echo "" + echo "$STATUS" + echo "" + echo "---------------------- Diff below ----------------------" + echo "" + git --no-pager diff + exit 1 +fi