Skip to content

Commit

Permalink
Add build tests for the example dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
tilosp committed Aug 10, 2017
1 parent 35d7c3c commit c7a0265
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions .travis/test-example-dockerfiles.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c7a0265

Please sign in to comment.