From 29bc30b8d3f5d0f88f6ad0d9a92a2303804ac66a Mon Sep 17 00:00:00 2001 From: Paul Caselton Date: Fri, 3 Jul 2015 22:23:06 +0100 Subject: [PATCH 1/2] Check for user defined nginx config --- bin/compile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/compile b/bin/compile index e21c7aa..78c4f7f 100755 --- a/bin/compile +++ b/bin/compile @@ -108,11 +108,17 @@ fi cd $CUR_DIR -# build nginx config unless overridden by user -#if [ ! -f $BUILD_DIR/nginx/nginx.conf ] ; then -echo "-----> using default nginx.conf.erb" -cp conf/nginx.conf.erb $BUILD_DIR/nginx/nginx.conf.erb -#fi + +# Test for user override on nginx config... +if [ -f $BUILD_DIR/nginx.conf.erb ] ; then + echo "-----> using user provided nginx.conf.erb" + cp $BUILD_DIR/nginx.conf.erb $BUILD_DIR/nginx/nginx.conf.erb + +# ...else, force default file +else + echo "-----> using default nginx.conf.erb" + cp conf/nginx.conf.erb $BUILD_DIR/nginx/nginx.conf.erb +fi # build mime.types unless overridden by user #if [ ! -f $BUILD_DIR/mime.types ] ; then From ebbc9098d98589545c3bcdfc5454c585464bfcf2 Mon Sep 17 00:00:00 2001 From: Paul Caselton Date: Sat, 4 Jul 2015 23:04:54 +0100 Subject: [PATCH 2/2] Fixing nginx user override. --- bin/compile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/compile b/bin/compile index 78c4f7f..4833af9 100755 --- a/bin/compile +++ b/bin/compile @@ -26,6 +26,8 @@ if [[ ! -e "$BUILD_DIR/www" ]]; then mv $BUILD_DIR/* $CACHE_DIR/www mkdir -p $BUILD_DIR/www mv $CACHE_DIR/www/* $BUILD_DIR/www + # Check for an copy the nginx conf file override to the build dir + [[ -f "$BUILD_DIR/www/nginx.conf.erb" ]] && mv $BUILD_DIR/www/nginx.conf.erb $BUILD_DIR [[ -f "$BUILD_DIR/www/CHECKS" ]] && mv $BUILD_DIR/www/CHECKS $BUILD_DIR rm -rf $CACHE_DIR/www fi @@ -113,6 +115,7 @@ cd $CUR_DIR if [ -f $BUILD_DIR/nginx.conf.erb ] ; then echo "-----> using user provided nginx.conf.erb" cp $BUILD_DIR/nginx.conf.erb $BUILD_DIR/nginx/nginx.conf.erb + rm $BUILD_DIR/nginx.conf.erb # ...else, force default file else