Shu Yingya 12efcf84e2 Add support to build 2.8.2 image
Also tweak Hive a bit and refer to artifacts in a new (but not totally
ideal) location.

Co-Authored-By: Jeremy Freudberg <jeremyfreudberg@gmail.com>
Change-Id: I3a25ee8c282849911089adf6c3593b1bb50fd067
2018-03-01 09:51:01 +08:00

25 lines
706 B
Bash
Executable File

#!/bin/bash
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
tmp_dir=$TARGET_ROOT/tmp/hive
mkdir -p $tmp_dir
if [ -z ${HIVE_DOWNLOAD_URL:-} ]; then
# hive package has renamed to "apache-hive-*" since 0.13.0
if [[ "$HIVE_VERSION" < "0.13.0" ]]; then
HIVE_FILE=hive-$HIVE_VERSION-bin.tar.gz
else
HIVE_FILE=apache-hive-$HIVE_VERSION-bin.tar.gz
fi
HIVE_DOWNLOAD_URL=http://archive.apache.org/dist/hive/hive-$HIVE_VERSION/$HIVE_FILE
fi
HIVE_FILE=$(basename $HIVE_DOWNLOAD_URL)
cached_tar="$DIB_IMAGE_CACHE/$HIVE_FILE"
$TMP_HOOKS_PATH/bin/cache-url $HIVE_DOWNLOAD_URL $cached_tar
sudo install -D -g root -o root -m 0644 $cached_tar $tmp_dir