aboutsummaryrefslogtreecommitdiffstats
path: root/script/rails-post-deploy
diff options
context:
space:
mode:
Diffstat (limited to 'script/rails-post-deploy')
-rwxr-xr-xscript/rails-post-deploy38
1 files changed, 30 insertions, 8 deletions
diff --git a/script/rails-post-deploy b/script/rails-post-deploy
index 575b995f9..2b66673c5 100755
--- a/script/rails-post-deploy
+++ b/script/rails-post-deploy
@@ -45,10 +45,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 "$APP_DIR/public/download" ]
then
- mkdir -p $APP_DIR/cache/zips/download
- ln -s $APP_DIR/cache/zips/download $APP_DIR/public/
+ mkdir -p "$APP_DIR/cache/zips/download"
+ ln -s "$APP_DIR/cache/zips/download" "$APP_DIR/public/"
fi
cd log
@@ -74,19 +74,41 @@ then
echo "ENV['RAILS_ENV'] ||= 'production'" > config/rails_env.rb
fi
+local bundle_install_options
if [ "$OPTION_STAGING_SITE" = "0" ]
then
- bundle exec bundle install --without development:test --deployment
+ bundle_install_options="--without development:test --deployment"
+fi
+
+# Ordinarily we would expect simply to run "bundle install" here.
+# However, at the time of writing there is a bug in bundler that
+# causes gems from github to be rebuilt every time bundle install
+# is run, which makes the process very extremely slow in our case
+# because Xapian takes a long time to build. Running
+# "bundle exec bundle install" is a workaround for this bug.
+#
+# However clearly one cannot run bundle exec till the bundle has
+# initially been installed, so we use a flag file .bundler-has-run
+# to indicate whether we are doing an initial install.
+#
+# If you ever need to rerun the initial install, just remove
+# this flag file.
+#
+# https://groups.google.com/forum/?fromgroups#!topic/alaveteli-dev/lCDuW9H4uBI
+if [ -e .bundler-has-run ]
+then
+ bundle exec bundle install $bundle_install_options
else
- bundle exec bundle install
+ bundle install $bundle_install_options
+ touch .bundler-has-run
fi
if [ -n "$OPTION_THEME_URLS" ]
then
for THEME in "${OPTION_THEME_URLS[@]}"
do
- echo "Installing $THEME..."
- script/plugin install --force $THEME
+ echo "Installing $THEME..."
+ script/plugin install --force $THEME
done
fi
@@ -94,7 +116,7 @@ fi
if [ -n "$OPTION_THEME_URL" ]
then
echo "Installing $OPTION_THEME_URL using deprecated THEME_URL..."
- script/plugin install --force $OPTION_THEME_URL
+ script/plugin install --force $OPTION_THEME_URL
fi
# upgrade database