Add build tests for the example dockerfiles

This commit is contained in:
Tilo Spannagel 2017-08-08 16:46:36 +02:00
parent 50b9eadbff
commit ce5b814886
No known key found for this signature in database
GPG Key ID: B89F1626A58E1429
2 changed files with 20 additions and 0 deletions

View File

@ -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

View File

@ -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