-
Notifications
You must be signed in to change notification settings - Fork 11
/
run.sh
executable file
·37 lines (31 loc) · 1.3 KB
/
run.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
#!/bin/bash
date > /tmp/rtlog.txt
DIR=`dirname $0`
source ${DIR}/functions.sh
# Kill the container right away
kill_container ${INASAFE_REALTIME_IMAGE}
SFTP_LOCAL_IP=$(get_sftp_local_ip)
SFTP_LOCAL_PORT=$(get_sftp_local_port)
SFTP_USER_NAME=$(get_sftp_user_name)
SFTP_USER_PASSWORD=$(get_sftp_user_password)
SFTP_BASE_PATH=$(get_sftp_base_path)
INSAFE_REALTIME_TEMPLATE=${REALTIME_DATA_DIR}/realtime-template.qpt
INSAFE_REALTIME_PROJECT=${REALTIME_DATA_DIR}/realtime.qgs
INASAFE_POPULATION_PATH=${REALTIME_DATA_DIR}/exposure/population.tif
GEONAMES_SQLITE_PATH=${REALTIME_DATA_DIR}/indonesia.sqlite
docker run --name="${INASAFE_REALTIME_IMAGE}" \
-e EQ_SFTP_BASE_URL=${SFTP_LOCAL_IP} \
-e EQ_SFTP_PORT=${SFTP_LOCAL_PORT} \
-e EQ_SFTP_USER_NAME=${SFTP_USER_NAME} \
-e EQ_SFTP_USER_PASSWORD=${SFTP_USER_PASSWORD} \
-e EQ_SFTP_BASE_PATH=${SFTP_BASE_PATH} \
-e INSAFE_REALTIME_TEMPLATE=${INSAFE_REALTIME_TEMPLATE} \
-e INSAFE_REALTIME_PROJECT=${INSAFE_REALTIME_PROJECT} \
-e INASAFE_POPULATION_PATH=${INASAFE_POPULATION_PATH} \
-e GEONAMES_SQLITE_PATH=${GEONAMES_SQLITE_PATH} \
-v ${INASAFE_SOURCE_DIR}:${INASAFE_SOURCE_DIR} \
-v ${REALTIME_DATA_DIR}:${REALTIME_DATA_DIR} \
-v ${SHAKE_CACHE_DIR}:${SHAKE_CACHE_DIR} \
-v ${SHAKE_EXTRACT_DIR}:${SHAKE_EXTRACT_DIR} \
-v ${WEB_DIR}:${WEB_DIR} \
-i -t aifdr/${INASAFE_REALTIME_IMAGE}