Shell scripts for build, start, stop, restart, nuke, logs, status. Shared helpers in _common.sh (colours, compose detection, project root). Updated CHEATSHEET.md with new tool references. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
606 B
Bash
Executable File
22 lines
606 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build or rebuild the derp container image.
|
|
# Usage: tools/build [--no-cache]
|
|
|
|
# shellcheck source=tools/_common.sh
|
|
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/_common.sh"
|
|
cd "$PROJECT_DIR" || exit 1
|
|
|
|
args=()
|
|
[[ "${1:-}" == "--no-cache" ]] && args+=(--no-cache)
|
|
|
|
dim "Building image..."
|
|
$COMPOSE build "${args[@]}"
|
|
|
|
size=$(podman image inspect "$IMAGE_NAME" --format '{{.Size}}' 2>/dev/null || true)
|
|
if [[ -n "$size" ]]; then
|
|
human=$(numfmt --to=iec-i --suffix=B "$size" 2>/dev/null || echo "${size} bytes")
|
|
info "Image built ($human)"
|
|
else
|
|
info "Image built"
|
|
fi
|