-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·47 lines (34 loc) · 966 Bytes
/
entrypoint.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
#!/usr/bin/env bash
set -e # fail on first error
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${DIR}"
source "${DIR}/env.sh"
##
if [ -z "${SLACK_WEBHOOK_URL}" ]; then
echo "${NAME}: SLACK_WEBHOOK_URL env is not set"
exit 1
fi
if [ -z "${ENVIRONMENT_TYPE}" ]; then
echo "${NAME}: ENVIRONMENT_TYPE env is not set"
exit 1
fi
if [ -z "${PROJECT_NAME}" ]; then
echo "${NAME}: PROJECT_NAME env is not set"
exit 1
fi
if [ -z "${FAILURE_NOTIFICATION_INTERVAL_S}" ]; then
echo "${NAME}: FAILURE_NOTIFICATION_INTERVAL_S env is not set"
exit 1
fi
##
if [ ! -d "${SPEC_DIR_IN_CONTAINER}" ]; then
echo "${NAME}: ${SPEC_DIR_IN_CONTAINER} volume does not exists"
exit 1
fi
if [ ! -d "${DATA_DIR_IN_CONTAINER}" ]; then
echo "${NAME}: ${DATA_DIR_IN_CONTAINER} volume does not exists"
exit 1
fi
##
cd ${SPEC_DIR_IN_CONTAINER} && npm install > /dev/null
cd ${APP_DIR_IN_CONTAINER} && npm run --silent monitor