CI: Add an obvious failure if the GITISH can't be computed

Not sure why the first build failed, but this might help.
This commit is contained in:
Zach Loafman 2016-08-16 16:42:10 -07:00
parent eea0d0140d
commit 39e6b85a67
1 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,8 @@ set -o nounset
set -o pipefail
readonly DOCKER_ROOT=$(dirname "${BASH_SOURCE}")
cd "${DOCKER_ROOT}" # To ensure we're in the git tree
readonly GITISH=${BUILD_GITISH:-"$(git show-ref -s --abbrev HEAD)"}
readonly ARCH=${BUILD_ARCH:-"linux/amd64"}
readonly NAME=${BUILD_NAME:-"ci-${GITISH}-${ARCH/\//-}"} # e.g. ci-bef7faf-linux-amd64
@ -19,6 +21,12 @@ if [[ "${ARCH}" != "linux/amd64" ]]; then
exit 1
fi
if [[ -z "${GITISH}" ]]; then
echo "!!! git hash not found, are you sure you're in a git tree and git is installed? !!!"
git config -l
exit 1
fi
echo
echo "=== Building at ${GITISH} for ${ARCH} (note: unable to build unpushed changes) ==="
echo