diff options
author | Tilo Spannagel <development@tilosp.de> | 2017-08-08 16:46:36 +0200 |
---|---|---|
committer | Tilo Spannagel <development@tilosp.de> | 2017-09-27 13:29:12 +0200 |
commit | ce5b8148861a64f5b840ec93c3eb38d1c3f7b6e5 (patch) | |
tree | 50886811c70fe933b4f67ce28cde3a106d4c04a0 | |
parent | 50b9eadbff868451dc4cd4294e3b0594120798dc (diff) |
Add build tests for the example dockerfiles
-rw-r--r-- | .travis.yml | 1 | ||||
-rwxr-xr-x | .travis/test-example-dockerfiles.sh | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index 9850771e..ff0cc5ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ before_script: script: - travis_retry docker build -t "$image" "${VERSION}/${VARIANT}" - ~/official-images/test/run.sh "$image" + - .travis/test-example-dockerfiles.sh "$image" after_script: - docker images diff --git a/.travis/test-example-dockerfiles.sh b/.travis/test-example-dockerfiles.sh new file mode 100755 index 00000000..e86ed162 --- /dev/null +++ b/.travis/test-example-dockerfiles.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +image="$1" + +cd .examples/dockerfiles + +dirs=( */ ) +dirs=( "${dirs[@]%/}" ) +for dir in "${dirs[@]}"; do + if [ -d "$dir/$VARIANT" ]; then + ( + cd "$dir/$VARIANT" + sed -ri -e 's/^FROM .*/FROM '"$image"'/g' 'Dockerfile' + docker build -t "$image-$dir" . + ~/official-images/test/run.sh "$image-$dir" + ) + fi +done |