Skip to content

Commit 5e41e5a

Browse files
committed
add image docker test bash wrapper in tasks/
1 parent 1179ed1 commit 5e41e5a

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

tasks/test_image.sh

100644100755
Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
#! /bin/bash
22
#
33
# TODO adapt this for Windows
4+
#
5+
# TODO add package.json config arguments to configure:
6+
# - container name,
7+
# - ports and
8+
# - imageserver version
9+
#
10+
# ===============================================================================
411

5-
# TODO add package.json config arguments to configure the container name,
6-
# ports and imageserver version
7-
8-
CONTAINER_NAME=""
12+
CONTAINER_NAME="imagetest"
13+
IMAGE_NAME="registry.plot.ly:5000/imageserver"
14+
IMAGE_VERSION="1.3.0"
915

16+
# Run docker container:
17+
#
18+
# docker run -d --name $CONTAINER_NAME \
19+
# -v $PWD/plotly.js:/var/www/streambed/image_server/plotly.js \
20+
# -p 9010:9010 -p 2022:22 \
21+
# $IMAGE_NAME:[$IMAGE_VERSION]
1022

11-
docker run -d --name $CONTAINER_NAME \
12-
-v $PWD/plotly.js:/var/www/streambed/image_server/plotly.js \
13-
-p 9010:9010 -p 2022:22 plotly/imageserver:[version]
23+
CMD=(
24+
"cd /var/www/streambed/image_server/plotly.js &&"
25+
"cp -f test/image/index.html ../server_app/index.html &&"
26+
"monit restart nw1 &&"
27+
"sleep 5 &&"
28+
"node test/image/compare_pixels_test.js $1"
29+
)
1430

15-
docker exec -i $CONTAINER_NAME /bin/bash \
16-
-c "cd /var/www/streambed/image_server/plotly.js && \
17-
cp -f test/image/index.html ../server_app/index.html && \
18-
monit restart nw1 && \
19-
sleep 5 && \
20-
node test/image/compare_pixels_test.js"
21-
31+
docker exec -i $CONTAINER_NAME /bin/bash -c "${CMD[*]}"

0 commit comments

Comments
 (0)