summaryrefslogtreecommitdiff
path: root/build/tools
diff options
context:
space:
mode:
authorKubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com>2019-08-19 18:20:10 +0800
committerGitHub <noreply@github.com>2019-08-19 18:20:10 +0800
commit82cb702ef7661588bade0bbd88a0e765405d0b74 (patch)
treeaf694c5a2426d98e1cf6c1915304e6bd95be3d6e /build/tools
parentMerge pull request #1043 from fisherxu/bluetooth (diff)
parentupdate dependencies (diff)
downloadkubeedge-82cb702ef7661588bade0bbd88a0e765405d0b74.tar.gz
Merge pull request #1016 from subpathdev/verifyVendor
adding verfify vendor script
Diffstat (limited to 'build/tools')
-rw-r--r--build/tools/verifyVendor.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/build/tools/verifyVendor.sh b/build/tools/verifyVendor.sh
new file mode 100644
index 000000000..371a5a819
--- /dev/null
+++ b/build/tools/verifyVendor.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+###
+#Copyright 2019 The KubeEdge Authors.
+#
+#Licensed under the Apache License, Version 2.0 (the "License");
+#you may not use this file except in compliance with the License.
+#You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing, software
+#distributed under the License is distributed on an "AS IS" BASIS,
+#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#See the License for the specific language governing permissions and
+#limitations under the License.
+###
+
+
+function checkModified {
+ modified=$( git status --short 2>/dev/null | grep -e "^.M" | wc -l)
+
+ if [ ${modified} -eq 0 ]; then
+ echo 0
+ return
+ fi
+
+ echo 2
+}
+
+go mod vendor
+ret=$(checkModified)
+if [ ${ret} -eq 0 ]; then
+ echo "SUCCESS: vendor is up to date"
+else
+ echo "FAILED: vendor needs an update; The diff is:"
+ git diff
+ exit 1
+fi
+
+go mod tidy
+ret=$(checkModified)
+if [ ${ret} -eq 0 ]; then
+ echo "SUCCESS: go.mod and go.sum are in tiny"
+else
+ echo "FAILED: go.mod / go.dum needs an update; The diff is:"
+ git diff
+ exit 1
+fi