diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-12-18 20:23:43 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-12-18 20:23:43 +0200 |
commit | 61c02920891b95e7d0779848ebe4f6b3d516592c (patch) | |
tree | cdee0f25362e47d6ea8f10301d4e959e777e2163 /stacksmith/user-scripts/boot.sh | |
parent | c8173fd9f9d220c7de40c9b7ecdca34d97181f26 (diff) | |
parent | 2fbcf7e9b61702a2c3311f813de2bb12a754b2b2 (diff) | |
download | wekan-61c02920891b95e7d0779848ebe4f6b3d516592c.tar.gz wekan-61c02920891b95e7d0779848ebe4f6b3d516592c.tar.bz2 wekan-61c02920891b95e7d0779848ebe4f6b3d516592c.zip |
Merge branch 'edge' into meteor-1.8
Diffstat (limited to 'stacksmith/user-scripts/boot.sh')
-rwxr-xr-x | stacksmith/user-scripts/boot.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/stacksmith/user-scripts/boot.sh b/stacksmith/user-scripts/boot.sh new file mode 100755 index 00000000..bd95102f --- /dev/null +++ b/stacksmith/user-scripts/boot.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -euxo pipefail + +# This file will store the config env variables needed by the app +readonly CONF=/build/env.config + +# EMAIL_URL can also be set here by injecting another env variable in the template +# ROOT_URL can also be set at runtime, by querying AWS api or by using ingress annotations in the template for k8s. + +cat >"${CONF}" <<'EOF' +export MONGO_URL=mongodb://{{DATABASE_USER}}:{{DATABASE_PASSWORD}}@{{DATABASE_HOST}}:{{DATABASE_PORT}}/{{DATABASE_NAME}} +export ROOT_URL=http://localhost +export PORT=3000 +EOF + +sed -i -e "s/{{DATABASE_USER}}/${DATABASE_USER}/" "${CONF}" +sed -i -e "s/{{DATABASE_PASSWORD}}/${DATABASE_PASSWORD}/" "${CONF}" +sed -i -e "s/{{DATABASE_HOST}}/${DATABASE_HOST}/" "${CONF}" +sed -i -e "s/{{DATABASE_PORT}}/${DATABASE_PORT}/" "${CONF}" +sed -i -e "s/{{DATABASE_NAME}}/${DATABASE_NAME}/" "${CONF}" + |