If "dep status" fails on CI, it's useful to know what version of dep is being used to locally reproduce and examine the issue.
57 lines
1.4 KiB
Bash
Executable File
57 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright 2017 The Kubernetes 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.
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/..
|
|
|
|
pushd "${SCRIPT_ROOT}"
|
|
echo "+++ Checking Gopkg.lock is up-to-date"
|
|
dep version
|
|
echo ""
|
|
dep status
|
|
popd
|
|
|
|
echo "+++ Checking vendor/ is up-to-date"
|
|
DIFFROOT="${SCRIPT_ROOT}/vendor"
|
|
TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/vendor"
|
|
_tmp="${SCRIPT_ROOT}/_tmp"
|
|
|
|
cleanup() {
|
|
rm -rf "${_tmp}"
|
|
}
|
|
trap "cleanup" EXIT SIGINT
|
|
|
|
cleanup
|
|
|
|
mkdir -p "${TMP_DIFFROOT}"
|
|
cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}"
|
|
|
|
"${SCRIPT_ROOT}/hack/update-deps.sh" -vendor-only
|
|
echo "diffing ${DIFFROOT} against freshly generated vendor dir"
|
|
ret=0
|
|
diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$?
|
|
cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}"
|
|
if [[ $ret -eq 0 ]]
|
|
then
|
|
echo "${DIFFROOT} up to date."
|
|
else
|
|
echo "${DIFFROOT} is out of date. Please run hack/update-deps.sh"
|
|
exit 1
|
|
fi
|