#!/usr/bin/env bash usage() { printf "$0 usage: \n -b: build all\n -v Postgres version\n" $0 exit 0 } build=N while getopts ":hd:bv:" arg; do case $arg in b) build=Y ;; v) version=${OPTARG} ;; h | *) usage ;; esac done [ "$build" = 'N' ] && exit 0 export API=data/sample-api-users docker build $API -f $API/Dockerfile.prod -t api:prod export CLIENT=data/sample-client-users docker build $CLIENT -f $CLIENT/Dockerfile -t client:prod export DB=data/db version="${version-13.3}" docker build $DB -f $DB/Dockerfile --build-arg "VERSION=${version}" -t "db:${version}"