Skip to content

Commit 63fd027

Browse files
committed
Allow passing args to docker user script
Signed-off-by: mdouglas47 <mdouglas47@bloomberg.net>
1 parent 84b1f31 commit 63fd027

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tests/docker/client

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ fi
4242
echo READY
4343

4444
if [[ -f /common/user_script ]]; then
45-
/common/user_script
45+
/common/user_script $(cat /common/user_script_args 2>/dev/null)
4646
fi

tests/docker/runit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -e
44
nodeprefix="m"
55

6+
script_args=()
67
while [[ $1 = -* ]]; do
78
if [[ "$1" = "-s" ]] || [[ "$1" = "--source" ]]; then
89
shift
@@ -19,6 +20,9 @@ while [[ $1 = -* ]]; do
1920
elif [[ "$1" = "-f" ]] || [[ "$1" = "--file" ]]; then
2021
shift
2122
script=$1
23+
elif [[ "$1" = "-a" ]] || [[ "$1" = "--file-arg" ]]; then
24+
shift
25+
script_args+=("$1")
2226
fi
2327
shift
2428
done
@@ -59,6 +63,10 @@ if [[ "$script" != "" ]]; then
5963
cp $script common/user_script
6064
chmod +x common/user_script
6165
fi
66+
if ((${#script_args[@]} > 0)); then
67+
printf '%s ' "${script_args[@]}" > common/user_script_args
68+
fi
69+
6270
docker build -t comdb2test:$prefix -f $src/tests/docker/Dockerfile.install $src
6371

6472
echo $cluster >common/cluster

0 commit comments

Comments
 (0)