Merge pull request #6 from ekohl/update-start.sh
Allow skipping the templating
This commit is contained in:
19
start.sh
19
start.sh
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Disable Strict Host checking for non interactive git clones
|
# 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
|
echo -e "Host *\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
|
||||||
|
|
||||||
# Pull down code form git for our site!
|
# Pull down code form git for our site!
|
||||||
@@ -21,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
|
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
|
# Very dirty hack to replace variables in code with ENVIRONMENT values
|
||||||
|
if [[ "$TEMPLATE_NGINX_HTML" != "0" ]] ; then
|
||||||
for i in $(env)
|
for i in $(env)
|
||||||
do
|
do
|
||||||
variable=$(echo "$i" | cut -d'=' -f1)
|
variable=$(echo "$i" | cut -d'=' -f1)
|
||||||
value=$(echo "$i" | cut -d'=' -f2)
|
value=$(echo "$i" | cut -d'=' -f2)
|
||||||
if [[ "$variable" != '%s' ]] ; then
|
if [[ "$variable" != '%s' ]] ; then
|
||||||
replace='\$\$_'${variable}'_\$\$'
|
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
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Start supervisord and services
|
# Start supervisord and services
|
||||||
/usr/local/bin/supervisord -n
|
/usr/local/bin/supervisord -n
|
||||||
|
|||||||
Reference in New Issue
Block a user