kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abu...@apache.org
Subject [kudu] branch master updated: [docker] Fix build to work outside of Git WD
Date Wed, 27 Feb 2019 19:27:38 GMT
This is an automated email from the ASF dual-hosted git repository.

abukor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 1aae078  [docker] Fix build to work outside of Git WD
1aae078 is described below

commit 1aae0784f675adf103de5fab19ae6cfb44723635
Author: Attila Bukor <abukor@apache.org>
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 <granthenke@apache.org>
    Tested-by: Attila Bukor <abukor@apache.org>
---
 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


Mime
View raw message