forked from documentdb/documentdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_setup_citus_core_oss.sh
More file actions
executable file
·63 lines (48 loc) · 1.61 KB
/
install_setup_citus_core_oss.sh
File metadata and controls
executable file
·63 lines (48 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# fail if trying to reference a variable that is not set.
set -u
# exit immediately if a command exits with a non-zero status
set -e
citusVersion=$1
source="${BASH_SOURCE[0]}"
while [[ -h $source ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptDir="$( cd -P "$( dirname "$source" )" && pwd )"
. $scriptDir/setup_versions.sh
CITUS_REF=$(GetCitusVersion $citusVersion)
. $scriptDir/utils.sh
if [ "${IVORYVERSION:-}" != "" ]; then
pgPath=$(GetPostgresPath $IVORYVERSION)
PATH=$pgPath:$PATH
fi
pushd $INSTALL_DEPENDENCIES_ROOT
rm -rf citus-repo
mkdir citus-repo
cd citus-repo
git init
git remote add origin https://github.com/citusdata/citus.git
git fetch --depth 1 origin "$CITUS_REF"
git checkout FETCH_HEAD
echo "building and installing citus extension ..."
./configure --without-lz4 --without-zstd --without-libcurl
make PATH=$PATH clean
if declare -F ProcessCitusMakefileGlobal > /dev/null; then
echo "Function ProcessCitusMakefileGlobal is defined"
ProcessCitusMakefileGlobal
else
echo "Function ProcessCitusMakefileGlobal is not defined"
fi
if [ "${DESTINSTALLDIR:-}" == "" ]; then
make PATH=$PATH -j$(cat /proc/cpuinfo | grep -c "processor") install
else
make PATH=$PATH DESTDIR=$DESTINSTALLDIR -j$(cat /proc/cpuinfo | grep -c "processor") install
fi
popd
if [ "${CLEANUP_SETUP:-"0"}" == "1" ]; then
rm -rf $INSTALL_DEPENDENCIES_ROOT/citus-repo
fi