Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions flink-cyber/cyber-jobs/src/main/resources/scripts/cs-lookup-jar
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,32 @@ if [ "$#" -ne 1 ]; then
fi
jar_prefix=$1

## Build the jar path
# Determine the location of the script to locate parcel
# Reference: http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
SOURCE="${BASH_SOURCE[0]}"
BIN_DIR="$(dirname "$SOURCE")"
while [ -h "$SOURCE" ]
do
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
BIN_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
done
BIN_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

# current directory
jar_paths=(".")
# CYBERSEC_HOME/jobs if defined
if [[ ! -z "${CYBERSEC_HOME}" ]]; then
jar_paths+=("${CYBERSEC_HOME}/jobs")
jar_paths+=("${CYBERSEC_HOME}/tools")
# first look relative to the bin directory, then look in /opt - allows overriding for testing
JOBS_DIR=${BIN_DIR}/../jobs
TOOLS_DIR=${BIN_DIR}/../tools

if [[ ! -z "${JOBS_DIR}" ]]; then
jar_paths+=("${JOBS_DIR}")
fi

if [[ ! -z "${TOOLS_DIR}" ]]; then
jar_paths+=("${TOOLS_DIR}")
fi

# parcel directory
jar_paths+=("/opt/cloudera/parcels/CYBERSEC/jobs")
jar_paths+=("/opt/cloudera/parcels/CYBERSEC/tools")
Expand Down
7 changes: 5 additions & 2 deletions flink-cyber/cyber-jobs/src/main/resources/scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ fi
# on the CDH parcel.
CDH_PARCEL_HOME=$BIN_DIR/../../CDH
if ! [ -d $CDH_PARCEL_HOME ]; then
echo '[ERROR] The CDH parcel directory was not found. Verify your Cloudera Distribution for Hadoop installation.' >&2
exit 1
CDH_PARCEL_HOME=$OPT_DIR/CDH
if ! [ -d $CDH_PARCEL_HOME ]; then
echo '[ERROR] The CDH parcel directory was not found. Verify your Cloudera Distribution for Hadoop installation.' >&2
exit 1
fi
fi

function run_java_class() {
Expand Down