urbit/sh/image

24 lines
400 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
build=${1:-}
if [[ -z "$build" ]]; then
build="urbit-image"
fi
say() {
echo "$1" >&2
}
say "Building $build..."
image="$(nix-build default.nix --no-out-link -A $build)"
say "Loading $image into Docker..."
tag="$(docker load --quiet --input $image)"
tag="${tag#Loaded image: }"
# Output only the tag on stdout for subsequent pipes/tooling.
echo $tag