ci: deploy/jjb.sh should fail on wrong arguments

In case the '--cmd' option is missing, usage() will be called and the
script exits with 0. A missing option is a failure, so make usage()
return and handle the exit status when usage() got called instead.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-11-04 10:47:22 +01:00 committed by mergify[bot]
parent 2ad602e9f2
commit 49c6784c5c

View File

@ -24,7 +24,6 @@ function usage() {
echo "--GIT_REPO specify the repo to build from (default: ${GIT_REPO})" echo "--GIT_REPO specify the repo to build from (default: ${GIT_REPO})"
echo "--help specify the flags" echo "--help specify the flags"
echo " " echo " "
exit 0
} }
ARGUMENT_LIST=( ARGUMENT_LIST=(
@ -62,7 +61,8 @@ while true; do
shift 2 ;; shift 2 ;;
--GIT_REPO) GIT_REPO=${2} --GIT_REPO) GIT_REPO=${2}
shift 2 ;; shift 2 ;;
--help) usage ;; --help) usage
exit 0 ;;
--) shift 1 --) shift 1
break ;; break ;;
esac esac
@ -71,7 +71,7 @@ done
if [ -z "${CMD}" ] if [ -z "${CMD}" ]
then then
echo "missing --cmd <command>." echo "missing --cmd <command>."
usage exit 1
fi fi
get_pod_status() { get_pod_status() {