generated from companieshouse/node-review-web-starter-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
29 lines (21 loc) · 820 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
29
#!/bin/bash
#
# Start script for acsp-manage-users-web
APP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ -z "${MESOS_SLAVE_PID}" ]]; then
echo "No mesos slave PID - Only configured for docker in development, not vagrant"
else
PORT="$1"
CONFIG_URL="$2"
ENVIRONMENT="$3"
APP_NAME="$4"
source /etc/profile
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"
exec node ${APP_DIR}/server.js -- $PORT
fi