From 675554b95c65a09b482ed1ffce24c8a0b6948194 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Fri, 29 Jan 2016 09:41:08 -0800 Subject: [PATCH] add build all script Signed-off-by: Jessica Frazelle --- build-all.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 build-all.sh diff --git a/build-all.sh b/build-all.sh new file mode 100755 index 0000000..a3694c1 --- /dev/null +++ b/build-all.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +# get the dockerfiles +IFS=$'\n' +files=( $(find . -iname '*Dockerfile' | sed 's|./||') ) +unset IFS + +# build the changed dockerfiles +for f in "${files[@]}"; do + image=${f%Dockerfile} + base=${image%%\/*} + suite=${image##*\/} + build_dir=$(dirname $f) + + if [[ -z "$suite" ]]; then + suite=latest + fi + + ( + set -x + docker build --rm --force-rm -t r.j3ss.co/${base}:${suite} ${build_dir} + ) + + echo " --- " + echo "Successfully built ${base}:${suite} with context ${build_dir}" + echo " --- " + + docker push --disable-content-trust=false r.j3ss.co/${base}:${suite} +done