From d6127082e9dba7978c67ddfd23df4a5fff883366 Mon Sep 17 00:00:00 2001 From: Jose Fuentes Date: Thu, 13 Dec 2018 20:27:35 +0100 Subject: Add stacksmith scripts --- stacksmith/user-scripts/boot.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 stacksmith/user-scripts/boot.sh (limited to 'stacksmith/user-scripts/boot.sh') diff --git a/stacksmith/user-scripts/boot.sh b/stacksmith/user-scripts/boot.sh new file mode 100755 index 00000000..2e3f1921 --- /dev/null +++ b/stacksmith/user-scripts/boot.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -eux + +#!/bin/bash + +set -euo pipefail + +# This file will store the config env variables needed by the app +readonly CONF=/build/env.config + +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}" + -- cgit v1.2.3-1-g7c22