mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Make hack/update-all.sh short-circuit unless run with -a
This commit is contained in:
parent
ca69c2e310
commit
9be7883f7e
@ -23,9 +23,13 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
|||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
||||||
|
|
||||||
SILENT=true
|
SILENT=true
|
||||||
|
ALL=false
|
||||||
|
|
||||||
while getopts ":v" opt; do
|
while getopts ":va" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
|
a)
|
||||||
|
ALL=true
|
||||||
|
;;
|
||||||
v)
|
v)
|
||||||
SILENT=false
|
SILENT=false
|
||||||
;;
|
;;
|
||||||
@ -36,10 +40,16 @@ while getopts ":v" opt; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
trap 'exit 1' SIGINT
|
||||||
|
|
||||||
if $SILENT ; then
|
if $SILENT ; then
|
||||||
echo "Running in the silent mode, run with -v if you want to see script logs."
|
echo "Running in the silent mode, run with -v if you want to see script logs."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! $ALL ; then
|
||||||
|
echo "Running in short-circuit mode; run with -a to force all scripts to run."
|
||||||
|
fi
|
||||||
|
|
||||||
BASH_TARGETS="codecgen
|
BASH_TARGETS="codecgen
|
||||||
generated-conversions
|
generated-conversions
|
||||||
generated-deep-copies
|
generated-deep-copies
|
||||||
@ -52,10 +62,22 @@ BASH_TARGETS="codecgen
|
|||||||
|
|
||||||
for t in $BASH_TARGETS
|
for t in $BASH_TARGETS
|
||||||
do
|
do
|
||||||
echo -e "Updating $t"
|
echo -e "${color_yellow}Updating $t${color_norm}"
|
||||||
if $SILENT ; then
|
if $SILENT ; then
|
||||||
bash "$KUBE_ROOT/hack/update-$t.sh" 1> /dev/null || echo -e "${color_red}FAILED${color_norm}"
|
if ! bash "$KUBE_ROOT/hack/update-$t.sh" 1> /dev/null; then
|
||||||
|
echo -e "${color_red}Updating $t FAILED${color_norm}"
|
||||||
|
if ! $ALL; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
bash "$KUBE_ROOT/hack/update-$t.sh"
|
if ! bash "$KUBE_ROOT/hack/update-$t.sh"; then
|
||||||
|
echo -e "${color_red}$Updating $t FAILED${color_norm}"
|
||||||
|
if ! $ALL; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo -e "${color_green}Update scripts completed successfully${color_norm}"
|
||||||
|
Loading…
Reference in New Issue
Block a user