blob: ee0a983554df4d4824ae430350a3787217124596 [file] [log] [blame]
#!/usr/bin/env bash
# source colors
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${dir}/colorizer-lib/colorizer.sh"
function build_images(){
cd /var/presentation/apps
apps=( node python ruby go blog )
# loop through langs
# build
for app in "${apps[@]}"; do
local app_conf=$(cat ${dir}/apps.json | jq .[] | jq 'select(.publish == "'${app}'")')
local lang=$(echo ${app_conf} | jq --raw-output '.lang')
local image_name=${lang}/base
if docker images | awk '{ print $1 }' | grep "^${image_name}$" > /dev/null; then
colorize "<red>${IMAGE_NAME} was already built!</red>"
else
colorize "<cyan>building ${lang}...</cyan>"
docker build --rm -t ${lang}/base ${app}/
fi
done
# clean up
/var/presentation/scripts/clean-docker
colorize "<white>Done!!</white>"
}
build_images