eric-maynard commented on code in PR #227:
URL: https://github.com/apache/polaris/pull/227#discussion_r1744284336
##########
run.sh:
##########
@@ -21,18 +21,57 @@
# Runs Polaris as a mini-deployment locally. Creates two pods that bind
themselves to port 8181.
-# deploy the registry
+# Initialize variables
+BUILD_ARGS="" # Initialize an empty string to store Docker build arguments
+
+# Function to display usage information
+usage() {
+ echo "Usage: $0 [-b build-arg1=value1,build-arg2=value2,...] [-h]"
+ echo " -b Pass a set of arbitrary build arguments to docker build,
separated by commas"
+ echo " -h Display this help message"
+ exit 1
+}
+
+# Parse command-line arguments
+while getopts "b:h" opt; do
+ case ${opt} in
+ b)
+ IFS=',' read -ra ARGS <<< "${OPTARG}" # Split the comma-separated list
into an array
+ for arg in "${ARGS[@]}"; do
+ BUILD_ARGS+=" --build-arg ${arg}" # Append each build argument to the
list
+ done
+ ;;
+ h)
+ usage
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+
+# Shift off the options and arguments
+shift $((OPTIND-1))
+
+# Deploy the registry
echo "Building Kind Registry..."
sh ./kind-registry.sh
-# build and deploy the server image
+# Check if BUILD_ARGS is not empty and print the build arguments
+if [[ -n "$BUILD_ARGS" ]]; then
+ echo "Building polaris image with build arguments:$BUILD_ARGS"
Review Comment:
nit: space missing after `:`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]