summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-09-20 10:43:14 +0200
committerValentin Rothberg <rothberg@redhat.com>2019-09-20 10:47:24 +0200
commite2cc41f44e545427eda5c916b089f69ae99e80a9 (patch)
tree049b443dee5e17e0926340c2f14762de69fb5f38
parent6e10770797c486ba1068d5a6580c7752714905c8 (diff)
add vendor checks to Makefile and the CI
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
-rw-r--r--.cirrus.yml2
-rw-r--r--Makefile9
-rwxr-xr-xhack/tree_status.sh15
3 files changed, 25 insertions, 1 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index d5498eb..fcca28b 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -61,6 +61,8 @@ validate_task:
validate_script:
- make validate
+ - make vendor
+ - ./hack/tree_status.sh
- make
test_task:
diff --git a/Makefile b/Makefile
index 31f8370..4d1cf4c 100644
--- a/Makefile
+++ b/Makefile
@@ -76,9 +76,16 @@ clean:
test: .install.ginkgo
$(GO) test -v ./...
+vendor:
+ export GO111MODULE=on \
+ $(GO) mod tidy && \
+ $(GO) mod vendor && \
+ $(GO) mod verify
+
.PHONY: \
binaries \
test \
gofmt \
lint \
- validate
+ validate \
+ vendor
diff --git a/hack/tree_status.sh b/hack/tree_status.sh
new file mode 100755
index 0000000..ac874a3
--- /dev/null
+++ b/hack/tree_status.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -e
+
+SUGGESTION="${SUGGESTION:-sync the vendor.conf 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"
+ exit 1
+fi