mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Makefiles for all modules
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019 The Kubernetes Authors.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
# verify all modules pass validation
|
||||
for i in $(find . -name go.mod -not -path "./site/*"); do
|
||||
pushd .
|
||||
cd $(dirname $i);
|
||||
go list -m -json all > /dev/null
|
||||
go mod tidy -v
|
||||
popd
|
||||
done
|
||||
|
||||
# Need better check. This is repeated git diff check
|
||||
# more pain than benefit for most people 25Apr2020
|
||||
## verify no changes to go.mods -- these should be part of the PR
|
||||
# find . -name go.sum | xargs git checkout --
|
||||
# git add .
|
||||
# git diff-index HEAD --exit-code
|
||||
42
hack/for-each-module.sh
Executable file
42
hack/for-each-module.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019 The Kubernetes Authors.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -x
|
||||
set -e
|
||||
set -o pipefail
|
||||
set -o nounset
|
||||
|
||||
if [[ -z "${1-}" ]] ; then
|
||||
echo "Usage: $0 <cmd>"
|
||||
echo "Example: $0 lint"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cmd=$1
|
||||
|
||||
seen=""
|
||||
kustomize_root=$(pwd | sed 's|kustomize/.*|kustomize/|')
|
||||
|
||||
# verify all modules pass validation
|
||||
for i in $(find . -name go.mod -not -path "./site/*"); do
|
||||
pushd .
|
||||
cd $(dirname $i);
|
||||
|
||||
set +x
|
||||
dir=$(pwd)
|
||||
module="${dir#$kustomize_root}"
|
||||
echo -e "\n----------------------------------------------------------"
|
||||
echo "Running command in $module"
|
||||
echo -e "----------------------------------------------------------"
|
||||
set -x
|
||||
|
||||
bash -c "$cmd"
|
||||
seen+=" - $module\n"
|
||||
popd
|
||||
done
|
||||
|
||||
set +x
|
||||
echo -e "\n\n----------------------------------------------------------"
|
||||
echo -e "SUCCESS: Ran '$cmd' on the following modules:"
|
||||
echo -e "$seen"
|
||||
Reference in New Issue
Block a user