-
Notifications
You must be signed in to change notification settings - Fork 140
/
set-env.sh
executable file
·60 lines (49 loc) · 1.48 KB
/
set-env.sh
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
#!/bin/bash
if [[ "${CURDIR:-}" == "" ]]; then
export CURDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
fi
function realpath {
echo "$(cd "$(dirname "$1")"; pwd)"/"$(basename "$1")";
}
if [[ "${CURDIR:-}" != "" && "${PROJECT_ROOT:-}" == "" ]]; then
SCRIPT_DIR=$(realpath "$(dirname "$CURDIR")")
export PROJECT_ROOT=$(realpath "$(dirname "$SCRIPT_DIR")")
echo "set PROJECT_ROOT to $PROJECT_ROOT"
fi
if [[ "${CONNECTORS_VERSION:-}" == "" ]]; then
SET_CONNECTORS_VERSION=`head -1 $PROJECT_ROOT/connectors/VERSION`
else
SET_CONNECTORS_VERSION="$CONNECTORS_VERSION"
fi
SET_STACK_VERSION="$SET_CONNECTORS_VERSION"
if [ "$use_snapshot" == true ]; then
SET_CONNECTORS_VERSION="$SET_CONNECTORS_VERSION-SNAPSHOT"
SET_STACK_VERSION="$SET_STACK_VERSION-SNAPSHOT"
fi
if [ -z "$ELASTICSEARCH_VERSION" ]
then
export ELASTICSEARCH_VERSION="$SET_STACK_VERSION"
fi
echo "ELASTICSEARCH_VERSION=$ELASTICSEARCH_VERSION"
if [ -z "$KIBANA_VERSION" ]
then
export KIBANA_VERSION="$SET_STACK_VERSION"
fi
echo "KIBANA_VERSION=$KIBANA_VERSION"
if [ -z "$CONNECTORS_VERSION" ]
then
export CONNECTORS_VERSION="$SET_CONNECTORS_VERSION"
fi
echo "CONNECTORS_VERSION=$CONNECTORS_VERSION"
if [ -z "$ELASTIC_PASSWORD" ]
then
export ELASTIC_PASSWORD="changeme"
fi
uname_value=`uname`
case "${uname_value:none}" in
Linux*) machine_os="Linux";;
Darwin*) machine_os="MacOS";;
FreeBSD*) machine_os="FreeBSD";;
*) machine_os="UNKNOWN:${uname_value}"
esac
export MACHINE_OS="$machine_os"