From 97df0a6d141b3e92782f728c0dd6bc3b96c18ca4 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 22 May 2015 10:09:39 +0200 Subject: [PATCH 1/2] Ensure /root/.ssh exists --- start.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/start.sh b/start.sh index c891fca..eaf1c0d 100644 --- a/start.sh +++ b/start.sh @@ -2,6 +2,7 @@ # Disable Strict Host checking for non interactive git clones +mkdir -p -m 0700 /root/.ssh echo -e "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config # Pull down code form git for our site! 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 2/2] 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