-
Notifications
You must be signed in to change notification settings - Fork 17
/
find-dqo-home.sh
executable file
·58 lines (51 loc) · 1.68 KB
/
find-dqo-home.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
#!/bin/bash
#
# Copyright © 2021-2024 DQOps (support@dqops.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Only attempt to find DQO_HOME if it is not set
if [ -z "$DQO_HOME" ]; then
export DQO_HOME=$(dirname "$0")/..
fi
if [ -z "$DQO_USER_HOME" ]; then
export DQO_USER_HOME=.
fi
if [ ! -d "$DQO_USER_HOME" ]; then
mkdir $DQO_USER_HOME
fi
if [ -z "$DQO_JAVA_OPTS" ]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
export DQO_JAVA_OPTS="-XX:MaxRAMPercentage=60.0 -Djavax.net.ssl.trustStoreType=KeychainStore"
else
export DQO_JAVA_OPTS="-XX:MaxRAMPercentage=60.0"
fi
fi
# Figure out where java is.
export DQO_RUNNER=java
if [ -n "$JAVA_HOME" ]; then
export DQO_RUNNER="$JAVA_HOME/bin/java"
else
printenv DQO_RUNNER >> /dev/null
returnedValue=$?
if [ $returnedValue -ne 0 ]; then
echo Java not found and JAVA_HOME environment variable is not set.
echo Install Java 17 or newer and set JAVA_HOME to point to the Java installation directory.
exit $returnedValue
fi
fi
if [ -e "$DQO_USER_HOME/jars/paid/dqops-paid-bin.jar" ]; then
export INCLUDE_DQOPS_PAID_JAR="-Dloader.path=$DQO_USER_HOME/jars/paid/dqops-paid-bin.jar"
else
export INCLUDE_DQOPS_PAID_JAR=
fi