mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 08:18:18 +00:00
Fix Docker-based Development Workflow (#1031)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
+30
-1
@@ -13,6 +13,8 @@ elif [ "${1#-}" != "$1" ]; then
|
||||
elif [ "$1" = "rustfs" ]; then
|
||||
shift
|
||||
set -- /usr/bin/rustfs "$@"
|
||||
elif [ "$1" = "cargo" ]; then
|
||||
: # Pass through cargo command as-is
|
||||
else
|
||||
set -- /usr/bin/rustfs "$@"
|
||||
fi
|
||||
@@ -22,8 +24,35 @@ DATA_VOLUMES=""
|
||||
process_data_volumes() {
|
||||
VOLUME_RAW="${RUSTFS_VOLUMES:-/data}"
|
||||
# Convert comma/tab to space
|
||||
VOLUME_LIST=$(echo "$VOLUME_RAW" | tr ',\t' ' ')
|
||||
VOLUME_LIST_RAW=$(echo "$VOLUME_RAW" | tr ',\t' ' ')
|
||||
|
||||
VOLUME_LIST=""
|
||||
for vol in $VOLUME_LIST_RAW; do
|
||||
# Helper to manually expand {N..M} since sh doesn't support it on variables
|
||||
if echo "$vol" | grep -E -q "\{[0-9]+\.\.[0-9]+\}"; then
|
||||
PREFIX=${vol%%\{*}
|
||||
SUFFIX=${vol##*\}}
|
||||
RANGE=${vol#*\{}
|
||||
RANGE=${RANGE%\}}
|
||||
START=${RANGE%%..*}
|
||||
END=${RANGE##*..}
|
||||
|
||||
# Check if START and END are numbers
|
||||
if [ "$START" -eq "$START" ] 2>/dev/null && [ "$END" -eq "$END" 2>/dev/null ]; then
|
||||
i=$START
|
||||
while [ "$i" -le "$END" ]; do
|
||||
VOLUME_LIST="$VOLUME_LIST ${PREFIX}${i}${SUFFIX}"
|
||||
i=$((i+1))
|
||||
done
|
||||
else
|
||||
# Fallback if not numbers
|
||||
VOLUME_LIST="$VOLUME_LIST $vol"
|
||||
fi
|
||||
else
|
||||
VOLUME_LIST="$VOLUME_LIST $vol"
|
||||
fi
|
||||
done
|
||||
|
||||
for vol in $VOLUME_LIST; do
|
||||
case "$vol" in
|
||||
/*)
|
||||
|
||||
Reference in New Issue
Block a user