Skip to content

Commit

Permalink
build_plugins.sh: handle opts being empty string
Browse files Browse the repository at this point in the history
Signed-off-by: Wesley Pettit <wppttt@amazon.com>
  • Loading branch information
PettitWesley committed Nov 12, 2022
1 parent 8caff0f commit dbab780
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions scripts/build_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ opts=$(getopt \
-- "$@"
)

echo "opts"
echo $opts

eval set -- "$opts"

# Build plugin build arguments
Expand All @@ -68,34 +65,40 @@ while [ $# -gt 0 ]
do
case "$1" in
--KINESIS_PLUGIN_CLONE_URL)
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg KINESIS_PLUGIN_CLONE_URL=$2"
if [ -n "$2" ];then PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg KINESIS_PLUGIN_CLONE_URL=$2";fi
shift 2;;
--KINESIS_PLUGIN_TAG)
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg KINESIS_PLUGIN_TAG=$2"
KINESIS_PLUGIN_TAG="$2"
if [ -n "$2" ];then
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg KINESIS_PLUGIN_TAG=$2"
KINESIS_PLUGIN_TAG="$2"
fi
shift 2;;
--KINESIS_PLUGIN_BRANCH)
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg KINESIS_PLUGIN_BRANCH=$2"
if [ -n "$2" ];then PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg KINESIS_PLUGIN_BRANCH=$2";fi
shift 2;;
--FIREHOSE_PLUGIN_CLONE_URL)
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg FIREHOSE_PLUGIN_CLONE_URL=$2"
if [ -n "$2" ];then PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg FIREHOSE_PLUGIN_CLONE_URL=$2";fi
shift 2;;
--FIREHOSE_PLUGIN_TAG)
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg FIREHOSE_PLUGIN_TAG=$2"
FIREHOSE_PLUGIN_TAG="$2"
if [ -n "$2" ];then
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg FIREHOSE_PLUGIN_TAG=$2"
FIREHOSE_PLUGIN_TAG="$2"
fi
shift 2;;
--FIREHOSE_PLUGIN_BRANCH)
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg FIREHOSE_PLUGIN_BRANCH=$2"
if [ -n "$2" ];then PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg FIREHOSE_PLUGIN_BRANCH=$2";fi
shift 2;;
--CLOUDWATCH_PLUGIN_CLONE_URL)
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg CLOUDWATCH_PLUGIN_CLONE_URL=$2"
if [ -n "$2" ];then PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg CLOUDWATCH_PLUGIN_CLONE_URL=$2";fi
shift 2;;
--CLOUDWATCH_PLUGIN_TAG)
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg CLOUDWATCH_PLUGIN_TAG=$2"
CLOUDWATCH_PLUGIN_TAG="$2"
if [ -n "$2" ];then
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg CLOUDWATCH_PLUGIN_TAG=$2"
CLOUDWATCH_PLUGIN_TAG="$2"
fi
shift 2;;
--CLOUDWATCH_PLUGIN_BRANCH)
PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg CLOUDWATCH_PLUGIN_BRANCH=$2"
if [ -n "$2" ];then PLUGIN_BUILD_ARGS="$PLUGIN_BUILD_ARGS --build-arg CLOUDWATCH_PLUGIN_BRANCH=$2";fi
shift 2;;
# End of arguments. End here and break.
--) shift; break ;;
Expand Down

0 comments on commit dbab780

Please sign in to comment.