-
Notifications
You must be signed in to change notification settings - Fork 1
/
activate
60 lines (51 loc) · 2.34 KB
/
activate
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
# ###############################################################
# PATHS
# ###############################################################
# Set indexer home.
export CDF2CIM_INDEXER_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set archive home.
if [[ -z "${CDF2CIM_ARCHIVE_HOME}" ]]; then
TEMP_VAR="$( cd "$( dirname "${CDF2CIM_INDEXER_HOME[0]}" )" && pwd )"
if [[ -d $TEMP_VAR/cdf2cim-archive ]]; then
export CDF2CIM_ARCHIVE_HOME=$TEMP_VAR/cdf2cim-archive
fi
unset TEMP_VAR
fi
# Set python path.
export PYTHONPATH=$CDF2CIM_INDEXER_HOME:$PYTHONPATH
# ###############################################################
# OPS
# ###############################################################
# Folders.
if [[ ! -d $CDF2CIM_INDEXER_HOME/ops/config ]]; then
mkdir -p $CDF2CIM_INDEXER_HOME/ops/config
cp $CDF2CIM_INDEXER_HOME/resources/*.conf $CDF2CIM_INDEXER_HOME/ops/config
fi
if [[ ! -d $CDF2CIM_INDEXER_HOME/ops/daemon ]]; then
mkdir -p $CDF2CIM_INDEXER_HOME/ops/daemon
fi
if [[ ! -d $CDF2CIM_INDEXER_HOME/ops/output ]]; then
mkdir -p $CDF2CIM_INDEXER_HOME/ops/output
fi
if [[ ! -d $CDF2CIM_INDEXER_HOME/ops/logs ]]; then
mkdir -p $CDF2CIM_INDEXER_HOME/ops/logs
fi
# Import environment variables.
if [[ -f $CDF2CIM_INDEXER_HOME/ops/config/env.conf ]]; then
source $CDF2CIM_INDEXER_HOME/ops/config/env.conf
fi
# Ensure shell scripts are executable.
chmod a+x $CDF2CIM_INDEXER_HOME/sh/*/*.sh
# ###############################################################
# ALIASES
# ###############################################################
alias cdf2cim-indexer-cache-flush='$CDF2CIM_INDEXER_HOME/sh/cache/flush.sh'
alias cdf2cim-indexer-exec-producer=$CDF2CIM_INDEXER_HOME/sh/mq/producer.sh
alias cdf2cim-indexer-interactive='$CDF2CIM_INDEXER_HOME/sh/mq/workers/interactive.sh'
alias cdf2cim-indexer-ls-vars=$CDF2CIM_INDEXER_HOME/sh/utils/ls_vars.sh
alias cdf2cim-indexer-workers=$CDF2CIM_INDEXER_HOME/sh/mq/workers/start.sh
alias cdf2cim-indexer-workers-reload=$CDF2CIM_INDEXER_HOME/sh/mq/workers/reload.sh
alias cdf2cim-indexer-workers-restart=$CDF2CIM_INDEXER_HOME/sh/mq/workers/restart.sh
alias cdf2cim-indexer-workers-start=$CDF2CIM_INDEXER_HOME/sh/mq/workers/start.sh
alias cdf2cim-indexer-workers-status=$CDF2CIM_INDEXER_HOME/sh/mq/workers/status.sh
alias cdf2cim-indexer-workers-stop=$CDF2CIM_INDEXER_HOME/sh/mq/workers/stop.sh