mirror of
https://github.com/wahyd4/cert-manager.git
synced 2026-08-19 01:56:11 +10:00
Update dep verify step to also ensure vendor is up to date
This commit is contained in:
@@ -83,7 +83,8 @@ deploy_verify:
|
||||
# Go targets
|
||||
#################
|
||||
dep_verify:
|
||||
dep status
|
||||
@echo Running dep
|
||||
$(HACK_DIR)/verify-deps.sh
|
||||
|
||||
go_verify: go_fmt go_test
|
||||
|
||||
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")
|
||||
REPO_ROOT="${SCRIPT_ROOT}/.."
|
||||
pushd "${REPO_ROOT}"
|
||||
echo "+++ Running dep ensure"
|
||||
dep ensure -v "$@"
|
||||
echo "+++ Cleaning up erroneous vendored testdata symlinks"
|
||||
rm -Rf vendor/github.com/prometheus/procfs/fixtures \
|
||||
vendor/github.com/hashicorp/go-rootcerts/test-fixtures \
|
||||
vendor/github.com/json-iterator/go/skip_tests
|
||||
popd
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/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 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
|
||||
Reference in New Issue
Block a user