Spotter-VM/openmapkit.sh

27 lines
934 B
Bash
Raw Normal View History

2017-12-19 20:27:51 +01:00
#!/bin/sh
SOURCE_DIR=$(realpath $(dirname "${0}"))/openmapkit
# Build Docker container
docker build -t openmapkit ${SOURCE_DIR}
# Configure OpenMapKit
export OMK_ADMIN_USER="admin"
export OMK_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
mkdir -p /srv/openmapkit/conf /srv/openmapkit/data/deployments /srv/openmapkit/data/submissions
chown -R 8007:8007 /srv/openmapkit/data
envsubst <${SOURCE_DIR}/srv/openmapkit/conf/settings.js >/srv/openmapkit/conf/settings.js
2017-12-12 13:29:33 +01:00
# Configure OpenMapKit service
2017-12-19 20:27:51 +01:00
cp ${SOURCE_DIR}/etc/init.d/openmapkit /etc/init.d/openmapkit
rc-update add openmapkit
2017-12-19 20:27:51 +01:00
service openmapkit start
# Create nginx app definition
2017-12-19 20:27:51 +01:00
cp ${SOURCE_DIR}/etc/nginx/conf.d/openmapkit.conf /etc/nginx/conf.d/openmapkit.conf
service nginx reload
# Add portal application definition
portal-app-manager openmapkit "https://{host}:8407/" admin "${OMK_ADMIN_PWD}"
portal-app-manager openmapkit-clients -p clienturl "http://{host}:8807"