summaryrefslogtreecommitdiff
path: root/hack/update-vendor.sh
diff options
context:
space:
mode:
authorzhangjie <iamkadisi@163.com>2019-09-30 20:48:31 +0800
committerzhangjie <iamkadisi@163.com>2019-10-01 17:59:39 +0800
commit7f60045bac1853839f709752b934d43a7973c3d4 (patch)
tree2da01a25afb5706a5f1efe9071122b7146f267e6 /hack/update-vendor.sh
parentcreate a symlink in vendor directory pointing to the staging components (diff)
downloadkubeedge-7f60045bac1853839f709752b934d43a7973c3d4.tar.gz
add verify-vendor.sh
Signed-off-by: zhangjie <iamkadisi@163.com>
Diffstat (limited to 'hack/update-vendor.sh')
-rwxr-xr-xhack/update-vendor.sh33
1 files changed, 7 insertions, 26 deletions
diff --git a/hack/update-vendor.sh b/hack/update-vendor.sh
index 592b64092..ed0abd0bc 100755
--- a/hack/update-vendor.sh
+++ b/hack/update-vendor.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
###
#Copyright 2019 The KubeEdge Authors.
@@ -16,6 +16,10 @@
#limitations under the License.
###
+set -o errexit
+set -o nounset
+set -o pipefail
+
# The root of the build/dist directory
KUBEEDGE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
@@ -30,38 +34,15 @@ function kubeedge::util::list_staging_repos() {
}
-function kubeedge::git::check_status() {
- modified=$( git status --short 2>/dev/null | wc -l)
- echo $modified
-}
-
-
+echo "running 'go mod tidy'"
go mod tidy
-ret=$(kubeedge::git::check_status)
-if [ ${ret} -eq 0 ]; then
- echo "SUCCESS: go.mod and go.sum are in tiny"
-else
- echo "FAILED: go.mod / go.sum needs an update"
- exit 1
-fi
-
+echo "running 'go mod vendor'"
go mod vendor
# create a symlink in vendor directory pointing to the staging components.
# This lets other packages and tools use the local staging components as if they were vendored.
for repo in $(kubeedge::util::list_staging_repos); do
rm -fr "${KUBEEDGE_ROOT}/vendor/github.com/kubeedge/${repo}"
- echo "PWD:"
- pwd
ln -s "../../../staging/src/github.com/kubeedge/${repo}/" "${KUBEEDGE_ROOT}/vendor/github.com/kubeedge/${repo}"
done
-
-
-ret=$(kubeedge::git::check_status)
-if [ ${ret} -eq 0 ]; then
- echo "SUCCESS: vendor is up to date"
-else
- echo "FAILED: vendor needs an update"
- exit 1
-fi