From 44ec166b8691743e0ffbcc108eaf41ab0d2ef3cd Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Tue, 26 Mar 2013 09:47:06 +1100 Subject: Change email address in header of source code to hello@mysociety.org --- script/rails-post-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index a1c613312..bd99b0ce2 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -6,7 +6,7 @@ # recent version. # # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. -# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ set -e #set -x # debug -- cgit v1.2.3 From 40f0272a3a15ea8b75bbd39c2cc2abd3074f8766 Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Tue, 2 Apr 2013 19:02:41 +0100 Subject: Enable rails-post-deploy to be run from any directory The BASH_SOURCE variable reliably gives the path of the script, so we can make the script work regardless of what the current working directory is on running the script. --- script/rails-post-deploy | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index bd99b0ce2..a9e239423 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -11,10 +11,15 @@ set -e #set -x # debug -APP_DIR=`pwd` +APP_DIR="$(readlink -f $(dirname "$BASH_SOURCE")/..)" +cd "$APP_DIR" # make sure that there is an app directory, so are in a rails app tree -cd app/.. +if ! [ -d app ] +then + echo "Error: the 'app' directory didn't exist" + exit 1 +fi # read config file in for later (STAGING_SITE) if [ -e "config/general" ] || [ -e "config/general.yml" ] -- cgit v1.2.3 From b4346ad162eb153fbe785cf9f6322f3e6305088a Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Wed, 29 May 2013 15:44:04 +0100 Subject: Now that runner is invoked via the rails command and not directly from the script directory, it's more important to cd to the app directory in order to pick up the bundler gemfile. Fixes #964. --- script/rails-post-deploy | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index a9e239423..4048c852f 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -11,8 +11,8 @@ set -e #set -x # debug -APP_DIR="$(readlink -f $(dirname "$BASH_SOURCE")/..)" -cd "$APP_DIR" +TOP_DIR="$(dirname "$BASH_SOURCE")/.." +cd "$TOP_DIR" # make sure that there is an app directory, so are in a rails app tree if ! [ -d app ] @@ -32,11 +32,11 @@ else fi # create initial log files -if [ -e $APP_DIR/../logs ] +if [ -e $TOP_DIR/../logs ] then # mySociety servers have logs dir in level above rm -f log - ln -s $APP_DIR/../logs log + ln -s $TOP_DIR/../logs log else # otherwise just make the directory if [ -h log ] @@ -47,10 +47,10 @@ else mkdir -p log fi # link the "downloads" directory in the cache to somewhere it can be served -if [ ! -e "$APP_DIR/public/download" ] +if [ ! -e "$TOP_DIR/public/download" ] then - mkdir -p "$APP_DIR/cache/zips/download" - ln -s "$APP_DIR/cache/zips/download" "$APP_DIR/public/" + mkdir -p "$TOP_DIR/cache/zips/download" + ln -s "$TOP_DIR/cache/zips/download" "$TOP_DIR/public/" fi cd log -- cgit v1.2.3