This is an automated email from the ASF dual-hosted git repository.
adar pushed a commit to branch branch-1.9.x
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/branch-1.9.x by this push:
new 6ddc337 [docker] Fix build to work outside of Git WD
6ddc337 is described below
commit 6ddc337ed76598c5c978ebeb7b8bb1bc764c75db
Author: Attila Bukor <[email protected]>
AuthorDate: Wed Feb 27 19:32:18 2019 +0100
[docker] Fix build to work outside of Git WD
The build script failed when being outside of a Git working directory.
This patch changes the VCS_REF to be the version info when it's not
built from a Git working directory.
Change-Id: I802157687384f3fd1b223d26041b3e8e1722b965
Reviewed-on: http://gerrit.cloudera.org:8080/12602
Reviewed-by: Grant Henke <[email protected]>
Tested-by: Attila Bukor <[email protected]>
(cherry picked from commit 1aae0784f675adf103de5fab19ae6cfb44723635)
Reviewed-on: http://gerrit.cloudera.org:8080/12650
Reviewed-by: Andrew Wong <[email protected]>
---
docker/docker-build.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/docker/docker-build.sh b/docker/docker-build.sh
index 742a6d0..2e5c9c6 100755
--- a/docker/docker-build.sh
+++ b/docker/docker-build.sh
@@ -105,10 +105,15 @@ TAG_HASH=${TAG_HASH:=0}
DOCKER_CACHE_FROM=${DOCKER_CACHE_FROM:=""}
VERSION=$(cat "$ROOT/version.txt")
-VCS_REF=$(git rev-parse --short HEAD)
+VCS_REF=$(git rev-parse --short HEAD || echo "")
# Create the VERSION_TAG.
if [[ "$VERSION" == *-SNAPSHOT ]]; then
+ if [[ "$VCS_REF" == "" ]]; then
+ echo "ERROR: Snapshot builds need to be built in a Git working directory"
+ exit 1
+ fi
+
IS_RELEASE_VERSION=0
VERSION_TAG="$VCS_REF"
else
@@ -233,4 +238,4 @@ if [[ "$PUBLISH" == 1 ]]; then
for TAG in "${TAGS[@]}"; do
docker push "${TAG}"
done
-fi
\ No newline at end of file
+fi