Skip to content

Commit

Permalink
add tag option to update script
Browse files Browse the repository at this point in the history
Signed-off-by: a3hadi <[email protected]>
  • Loading branch information
ayildirim21 committed Mar 11, 2024
1 parent 44ab995 commit d31f517
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions update_examples.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

function show_help () {
echo "Usage: $0 [-h|--help | -t|--tag] (-bp|--build-push | -bpe|--build-push-example | -u|--update <SDK-version>)"
echo "Usage: $0 [-h|--help | -t|--tag <tag>] (-bp|--build-push | -bpe|--build-push-example | -u|--update <SDK-version>)"
echo " -h, --help Display help message and exit"
echo " -bp, --build-push Build the Dockerfiles of all the examples and push them to the quay.io registry"
echo " -bpe, --build-push-example Build the Dockerfile of the given example directory path, and push it to the quay.io registry"
Expand Down Expand Up @@ -102,6 +102,18 @@ if (( usingBuildPush + usingBuildPushExample + usingVersion + usingHelp > 1 ));
exit 1
fi

if (( usingTag + usingVersion > 1 )); then
echo "Cannot use -t with -u" >&2
show_help
exit 1
fi

if (( usingTag )) && (( usingBuildPush + usingBuildPushExample == 0 )); then
echo "Cannot run -t alone, please use it with -bpe or -bp" >&2
show_help
exit 1
fi

if [ -n "$version" ]; then
echo "Will update to: $version"
fi
Expand All @@ -110,7 +122,7 @@ if [ -n "$directoryPath" ]; then
echo "Dockerfile path to use: $directoryPath"
fi

if [ -n "$tag" ]; then
if [ -n "$tag" ] && (( usingTag )); then
echo "Using tag: $tag"
fi

Expand Down

0 comments on commit d31f517

Please sign in to comment.