aboutsummaryrefslogtreecommitdiffstats
path: root/prod_bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'prod_bootstrap.sh')
-rwxr-xr-xprod_bootstrap.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/prod_bootstrap.sh b/prod_bootstrap.sh
new file mode 100755
index 0000000..c1de926
--- /dev/null
+++ b/prod_bootstrap.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -euo pipefail
+DIR="${1}"
+VALID_ENV_KEYS=$(printenv | awk -F '=' '{ print $1 }' | tail | awk 'NF')
+
+for f in $(find ${DIR} -regex '.*\.js'); do
+ for envKey in ${VALID_ENV_KEYS}; do
+ replaced=$(printenv ${envKey})
+ sed -i "s|%${envKey}|${replaced}|g" "${f}"
+ echo "[bootstrap] Replaced ${envKey} from container environment."
+ done
+done
+
+nginx -g "daemon off;"