Skip to content

Commit

Permalink
Add a script to simplify testing changes to the project
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mark-adams committed Aug 18, 2017
1 parent 924842d commit d9e4f6d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d9e4f6d

Please sign in to comment.