From d9e4f6dc422a52fad95e4dafd37c5c29c680b593 Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Fri, 18 Aug 2017 04:50:12 -0500 Subject: [PATCH] Add a script to simplify testing changes to the project Currently, each image has to be built and tested manually. This change allows for a single script to be executed that will build all of the images and run the samples as a form of test for the images. --- run_tests.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 run_tests.sh diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..b7f6560 --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e + +# This script builds all the Docker images and runs the samples + +# Rebuild the base image +docker build --pull -t markadams/chromium-xvfb -f images/base/Dockerfile images/base/ + +# Build Python 2 image +docker build -f images/python2-onbuild/Dockerfile -t markadams/chromium-xvfb-py2:latest-onbuild images/python2-onbuild +docker build -f samples/python2/Dockerfile -t markadams/chromium-xvfb-py2-sample samples/python2 + +# Build Python 3 image +docker build -f images/python3-onbuild/Dockerfile -t markadams/chromium-xvfb-py3:latest-onbuild images/python3-onbuild +docker build -f samples/python3/Dockerfile -t markadams/chromium-xvfb-py3-sample samples/python3 + +# Build JS images +docker build -f images/js/Dockerfile-6.x -t markadams/chromium-xvfb-js:6 images/js +docker build -f images/js-onbuild/Dockerfile-6.x -t markadams/chromium-xvfb-js:6-onbuild images/js-onbuild + +docker build -f images/js/Dockerfile-7.x -t markadams/chromium-xvfb-js:7 images/js +docker build -f images/js-onbuild/Dockerfile-7.x -t markadams/chromium-xvfb-js:7-onbuild images/js-onbuild + +docker build -f samples/js/Dockerfile -t markadams/chromium-xvfb-js-sample samples/js + +# Run samples to test +docker run --rm markadams/chromium-xvfb-py2-sample +docker run --rm markadams/chromium-xvfb-py3-sample +docker run --rm markadams/chromium-xvfb-js-sample