mirror of https://github.com/kubernetes/kops.git
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:
parent
eea0d0140d
commit
39e6b85a67
|
@ -5,6 +5,8 @@ set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
readonly DOCKER_ROOT=$(dirname "${BASH_SOURCE}")
|
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 GITISH=${BUILD_GITISH:-"$(git show-ref -s --abbrev HEAD)"}
|
||||||
readonly ARCH=${BUILD_ARCH:-"linux/amd64"}
|
readonly ARCH=${BUILD_ARCH:-"linux/amd64"}
|
||||||
readonly NAME=${BUILD_NAME:-"ci-${GITISH}-${ARCH/\//-}"} # e.g. ci-bef7faf-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
|
exit 1
|
||||||
fi
|
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
|
||||||
echo "=== Building at ${GITISH} for ${ARCH} (note: unable to build unpushed changes) ==="
|
echo "=== Building at ${GITISH} for ${ARCH} (note: unable to build unpushed changes) ==="
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Reference in New Issue