-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
28 lines (23 loc) · 892 Bytes
/
start.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
#!/bin/bash
#
# Start script for item-group-consumer
APP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ -z "${MESOS_SLAVE_PID}" ]]; then
source ~/.chs_env/private_env
source ~/.chs_env/global_env
source ~/.chs_env/item-group-consumer/env
PORT="${SERVER_PORT}"
else
PORT="$1"
CONFIG_URL="$2"
ENVIRONMENT="$3"
APP_NAME="$4"
echo "Downloading environment from: ${CONFIG_URL}/${ENVIRONMENT}/${APP_NAME}"
wget -O "${APP_DIR}/private_env" "${CONFIG_URL}/${ENVIRONMENT}/private_env"
wget -O "${APP_DIR}/global_env" "${CONFIG_URL}/${ENVIRONMENT}/global_env"
wget -O "${APP_DIR}/app_env" "${CONFIG_URL}/${ENVIRONMENT}/${APP_NAME}/env"
source "${APP_DIR}/private_env"
source "${APP_DIR}/global_env"
source "${APP_DIR}/app_env"
fi
exec java ${JAVA_MEM_ARGS} -jar -Dserver.port="${PORT}" "${APP_DIR}/item-group-consumer.jar"