Skip to content

Commit

Permalink
improved post_build hook robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Aug 25, 2017
1 parent 7f99c17 commit 95240b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hbase/hooks/post_build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x

docker_branch_base="$(basename "$(dirname "${BASH_SOURCE[0]}")/..")"
if [ -z "${SOURCE_BRANCH:-}" ]; then
SOURCE_BRANCH="$(git branch | sed -n 's/*[[:space:]]*//p')"
fi
# readlink is not portable across Linux + Mac
docker_branch_base="$(basename "$(cd "$(dirname "${BASH_SOURCE[0]}")/.."; echo "$PWD")")"
docker_branch_base="${docker_branch_base%-dev}"
docker_branch_base="${docker_branch_base%-cluster}"
if [ "$docker_branch_base" = "kafka" ]; then
Expand Down

0 comments on commit 95240b6

Please sign in to comment.