2017-12-19 20:27:51 +01:00
|
|
|
#!/bin/sh
|
2017-12-12 05:48:36 +01:00
|
|
|
|
|
|
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/openmapkit
|
|
|
|
|
2017-12-13 17:16:08 +01:00
|
|
|
# Build Docker container
|
|
|
|
docker build -t openmapkit ${SOURCE_DIR}
|
2017-12-12 05:48:36 +01:00
|
|
|
|
|
|
|
# Configure OpenMapKit
|
|
|
|
export OMK_ADMIN_USER="admin"
|
|
|
|
export OMK_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
|
2018-01-15 20:06:06 +01:00
|
|
|
mkdir -p /srv/openmapkit/data/deployments /srv/openmapkit/data/submissions
|
2017-12-13 17:16:08 +01:00
|
|
|
envsubst <${SOURCE_DIR}/srv/openmapkit/settings.js >/srv/openmapkit/settings.js
|
|
|
|
chown -R 8007:8007 /srv/openmapkit/data
|
2017-12-12 13:29:33 +01:00
|
|
|
|
2017-12-12 05:48:36 +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 boot
|
|
|
|
service openmapkit start
|
2017-12-12 05:48:36 +01:00
|
|
|
|
2017-12-19 22:16:13 +01:00
|
|
|
# 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
|
2017-12-12 05:48:36 +01:00
|
|
|
|
|
|
|
# Add portal application definition
|
2017-12-13 17:16:08 +01:00
|
|
|
portal-app-manager openmapkit "https://{host}:8407/" admin "${OMK_ADMIN_PWD}"
|
|
|
|
portal-app-manager openmapkit-clients -p clienturl "http://{host}:8007"
|