mirror of https://github.com/docker/docs.git
Merge pull request #2804 from tianon/fix-hack-git-assumption
Hack: add support for compiling using make.sh without '.git'
This commit is contained in:
commit
6acdf68ee1
16
hack/make.sh
16
hack/make.sh
|
@ -41,9 +41,19 @@ DEFAULT_BUNDLES=(
|
||||||
)
|
)
|
||||||
|
|
||||||
VERSION=$(cat ./VERSION)
|
VERSION=$(cat ./VERSION)
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
if [ -d .git ] && command -v git &> /dev/null; then
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
GITCOMMIT=$(git rev-parse --short HEAD)
|
||||||
GITCOMMIT="$GITCOMMIT-dirty"
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
GITCOMMIT="$GITCOMMIT-dirty"
|
||||||
|
fi
|
||||||
|
elif [ "$DOCKER_GITCOMMIT" ]; then
|
||||||
|
GITCOMMIT="$DOCKER_GITCOMMIT"
|
||||||
|
else
|
||||||
|
echo >&2 'error: .git directory missing and DOCKER_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 DOCKER_GITCOMMIT for'
|
||||||
|
echo >&2 ' future accountability in diagnosing build issues. Thanks!'
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use these flags when compiling the tests and final binary
|
# Use these flags when compiling the tests and final binary
|
||||||
|
|
Loading…
Reference in New Issue