#!/bin/bash VERSION=$(< ./VERSION) if command -v git &> /dev/null && git rev-parse &> /dev/null; then GITCOMMIT=$(git rev-parse --short HEAD) if [ -n "$(git status --porcelain --untracked-files=no)" ]; then GITCOMMIT="$GITCOMMIT" fi BUILDTIME=$(date -u) elif [ "$HYPER_GITCOMMIT" ]; then GITCOMMIT="$HYPER_GITCOMMIT" else echo >&2 'error: .git directory missing and HYPER_GITCOMMIT not specified' echo >&2 ' Please either build with the .git directory accessible, or specify the' echo >&2 ' exact (--short) commit hash you are building using HYPER_GITCOMMIT for' echo >&2 ' future accountability in diagnosing build issues. Thanks!' exit 1 fi cat > dockerversion/version_autogen.go <