From 3cef700b9da8bc4ac108695907870fbf463e2905 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 22 May 2015 10:11:42 +0200 Subject: [PATCH] Allow skipping the templating When you have a large code base, the templating can take some time. This allows you to skip it if you have no interest in it. Maybe a more sane default would be to disable it unless explicitly activated, but that would be backwards incompatible. --- start.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/start.sh b/start.sh index eaf1c0d..0781b1d 100644 --- a/start.sh +++ b/start.sh @@ -22,15 +22,17 @@ procs=$(cat /proc/cpuinfo |grep processor | wc -l) sed -i -e "s/worker_processes 5/worker_processes $procs/" /etc/nginx/nginx.conf # Very dirty hack to replace variables in code with ENVIRONMENT values - -for i in $(env) -do - variable=$(echo "$i" | cut -d'=' -f1) - value=$(echo "$i" | cut -d'=' -f2) - if [[ "$variable" != '%s' ]] ; then - replace='\$\$_'${variable}'_\$\$' - find /usr/share/nginx/html -type f -exec sed -i -e 's/'${replace}'/'${value}'/g' {} \; ; fi +if [[ "$TEMPLATE_NGINX_HTML" != "0" ]] ; then + for i in $(env) + do + variable=$(echo "$i" | cut -d'=' -f1) + value=$(echo "$i" | cut -d'=' -f2) + if [[ "$variable" != '%s' ]] ; then + replace='\$\$_'${variable}'_\$\$' + find /usr/share/nginx/html -type f -exec sed -i -e 's/'${replace}'/'${value}'/g' {} \; + fi done +fi # Start supervisord and services /usr/local/bin/supervisord -n