feat: container management tools in tools/
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>
This commit is contained in:
21
tools/build
Executable file
21
tools/build
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user