pediatric-ai-scribe-v3/scripts/build-image.sh

16 lines
536 B
Bash
Executable file

#!/bin/sh
# Build only; this never starts services. COMPOSE_FILE selects an alternate Compose file.
set -eu
cd "$(dirname "$0")/.."
if [ -e .git ]; then
GIT_REVISION=$(env -i PATH="$PATH" HOME="${HOME:-}" git rev-parse --verify 'HEAD^{commit}')
printf '%s\n' "$GIT_REVISION" | grep -Eq '^[0-9a-f]{40}$' || {
echo 'Expected a full lowercase Git SHA' >&2
exit 1
}
else
GIT_REVISION=unknown
echo 'Unversioned development build: revision unknown' >&2
fi
export GIT_REVISION
exec docker compose build "$@" pediatric-scribe