imagebuilder: add nice headings

This commit is contained in:
Starbeamrainbowlabs 2020-09-05 21:10:37 +01:00
parent 33ee5849db
commit 39e173e2c6
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -74,6 +74,11 @@ fi
###############################################################################
case "${subcommand}" in
# ██ ██ ███████ ████████
# ██ ██ ██ ██
# ██ ██ ███████ ██
# ██ ██ ██ ██
# ███████ ██ ███████ ██
list)
while read -r filepath; do
filepath_stripped="${filepath#"${BASE_PATH}"}";
@ -85,6 +90,12 @@ case "${subcommand}" in
done < <(find "${BASE_PATH}" -maxdepth 1 -type d);
;;
# ██████ ██ ██ ██ ██ ██████
# ██ ██ ██ ██ ██ ██ ██ ██
# ██████ ██ ██ ██ ██ ██ ██
# ██ ██ ██ ██ ██ ██ ██ ██
# ██████ ██████ ██ ███████ ██████
build)
imagename="${1}";
@ -108,6 +119,11 @@ case "${subcommand}" in
imagetype="$(tr -d "[:blank:]" <"${imagedir}/type.txt")";
case "${imagetype}" in
# ██████ ██████ ██████ ██ ██ ███████ ██████
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
# ██ ██ ██ ██ ██ █████ █████ ██████
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
# ██████ ██████ ██████ ██ ██ ███████ ██ ██
docker)
if [[ ! -f "${imagedir}/Dockerfile" ]]; then
echo -e "Error: Failed to find a Dockerfile at ${HC}${imagedir}/Dockerfile${RS}.";
@ -139,6 +155,12 @@ case "${subcommand}" in
fi
;;
# ██████ █████ ███████ ███████
# ██ ██ ██ ██ ██ ██
# ██████ ███████ ███████ █████
# ██ ██ ██ ██ ██ ██
# ██████ ██ ██ ███████ ███████
base|base-nopush)
builderscript="${imagedir}/${imagename}.sh";
if [[ ! -x "${builderscript}" ]]; then
@ -180,6 +202,12 @@ case "${subcommand}" in
task_end "$?";
;;
# ██ ██ ███ ██ ██ ██ ███ ██ ██████ ██ ██ ███ ██
# ██ ██ ████ ██ ██ ██ ████ ██ ██ ██ ██ ██ ████ ██
# ██ ██ ██ ██ ██ █████ ██ ██ ██ ██ ██ ██ █ ██ ██ ██ ██
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██
# ██████ ██ ████ ██ ██ ██ ████ ██████ ███ ███ ██ ████
*)
echo -e "Error: The image type ${HC}${imagetype}${RS} was not recognised. Currently recognised types: base, base-nopush, docker";
exit 4;