add ability to build local variants from a ./.code directory

This commit is contained in:
Dietrich Rink
2023-06-10 15:50:08 +02:00
parent b3216433c4
commit 6d0bf0957f
2 changed files with 15 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
set -euo pipefail
shopt -s extglob
cd "$(dirname "$0")"
readonly DIR="$(cd "$(dirname "$0")"; pwd)"
if (( $# == 0 )); then
readonly images=(core basic !(template|core|basic)/)
@@ -11,5 +11,13 @@ else
fi
for image in "${images[@]}"; do
podman build -t "code-${image%/}" -f "${image%/}/Containerfile"
if [[ "$image" == '.' ]]; then
tag="$(basename "$(pwd)")"
contdir='.code'
else
tag="$image"
contdir="$DIR/${image%/}"
fi
podman build -t "code-${tag}" -f "${contdir}/Containerfile"
done