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.
This commit is contained in:
Ewoud Kohl van Wijngaarden
2015-05-22 10:11:42 +02:00
parent 97df0a6d14
commit 3cef700b9d

View File

@@ -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
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
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