From e7938406d918ce362642c372186cd4c43801dc29 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 22 Feb 2012 13:48:11 +0000 Subject: cause the post-deploy process to run "bundler install" --- script/rails-post-deploy | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index d9e9bb3f1..4df37db34 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -78,7 +78,12 @@ if [ -n "$OPTION_THEME_URL" ] then script/plugin install --force $OPTION_THEME_URL fi - +if [ "$OPTION_STAGING_SITE" = "0" ] +then + bundle install --deployment +else + bundle install +fi # upgrade database rake db:migrate #--trace -- cgit v1.2.3 From 8acea24f98268fbb9b73b66b9e98a1788a3b30ac Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Mon, 12 Mar 2012 12:33:12 +0000 Subject: Do 'bundler' stuff in correct order --- script/rails-post-deploy | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index 4df37db34..2bf098c5d 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -74,16 +74,18 @@ then echo "ENV['RAILS_ENV'] ||= 'production'" > config/rails_env.rb fi -if [ -n "$OPTION_THEME_URL" ] -then - script/plugin install --force $OPTION_THEME_URL -fi if [ "$OPTION_STAGING_SITE" = "0" ] then bundle install --deployment else bundle install fi + +if [ -n "$OPTION_THEME_URL" ] +then + script/plugin install --force $OPTION_THEME_URL +fi + # upgrade database rake db:migrate #--trace -- cgit v1.2.3 From 6294bddb67defe5b3a0bfc5a17a15576024d2c1f Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Tue, 13 Mar 2012 11:19:50 +0000 Subject: in production mode, ensure we skip development and test gems --- 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 2bf098c5d..6e2c88d28 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -76,7 +76,7 @@ fi if [ "$OPTION_STAGING_SITE" = "0" ] then - bundle install --deployment + bundle install --without development:test --deployment else bundle install fi -- cgit v1.2.3 From 790d8575214e254c1923aa40095171405dbba321 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Fri, 4 May 2012 10:51:34 +0100 Subject: Now we use bundler, update all scripts to exec `rake` as `bundle exec rake` --- 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 6e2c88d28..4edabc9a7 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -87,6 +87,6 @@ then fi # upgrade database -rake db:migrate #--trace +bundle exec rake db:migrate #--trace -- cgit v1.2.3 From 4e6b9e554d2fe8d6eb65bde4fad312ae11a06f8a Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 16 May 2012 11:26:36 +0100 Subject: Use "bundle exec bundle install" (ugh) as a workaround for the fact that in deployment mode, the xapian-full gem gets recompiled every time --- script/rails-post-deploy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index 4edabc9a7..b0c0acdc5 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -76,9 +76,9 @@ fi if [ "$OPTION_STAGING_SITE" = "0" ] then - bundle install --without development:test --deployment + bundle exec bundle install --without development:test --deployment else - bundle install + bundle exec bundle install fi if [ -n "$OPTION_THEME_URL" ] -- cgit v1.2.3 From 2e69a53ff5c3e15dd5a7a0fcb5f8fcedf3d6f778 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 16 May 2012 14:42:47 +0100 Subject: Introduce ability to install multiple, layered themes. --- script/rails-post-deploy | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index b0c0acdc5..370819c67 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -81,6 +81,16 @@ else bundle exec bundle install fi +if [ -n "$OPTION_THEME_URLS" ] +then + echo $OPTION_THEME_URLS + for THEME in $OPTION_THEME_URLS + do + script/plugin install --force $THEME + done +fi + +# Old version of the above, for backwards compatibility if [ -n "$OPTION_THEME_URL" ] then script/plugin install --force $OPTION_THEME_URL -- cgit v1.2.3 From 1df22df692f183a1ede4660a7a0b056311c1ba14 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Tue, 22 May 2012 08:59:06 +0100 Subject: Correctly iterate over THEME_URLS array --- script/rails-post-deploy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index 370819c67..575b995f9 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -83,9 +83,9 @@ fi if [ -n "$OPTION_THEME_URLS" ] then - echo $OPTION_THEME_URLS - for THEME in $OPTION_THEME_URLS + for THEME in "${OPTION_THEME_URLS[@]}" do + echo "Installing $THEME..." script/plugin install --force $THEME done fi @@ -93,6 +93,7 @@ fi # Old version of the above, for backwards compatibility if [ -n "$OPTION_THEME_URL" ] then + echo "Installing $OPTION_THEME_URL using deprecated THEME_URL..." script/plugin install --force $OPTION_THEME_URL fi -- cgit v1.2.3 From c8e1af1d9885ad1cc0dc6d567f99be10b48413ec Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Thu, 31 May 2012 09:37:39 +0100 Subject: Bundler fix for rails-post-deploy 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. --- script/rails-post-deploy | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'script/rails-post-deploy') 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 -- cgit v1.2.3 From 845575c3a5f4b6d1d4fa14fdce3908c2e1f7169b Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Thu, 31 May 2012 09:39:29 +0100 Subject: local can only be used in a function --- 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 2b66673c5..a2761ecbc 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -74,7 +74,7 @@ then echo "ENV['RAILS_ENV'] ||= 'production'" > config/rails_env.rb fi -local bundle_install_options +bundle_install_options="" if [ "$OPTION_STAGING_SITE" = "0" ] then bundle_install_options="--without development:test --deployment" -- cgit v1.2.3 From 9f5ad85b6ff541a8e4dc83e91548af9c745d64af Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Thu, 31 May 2012 11:03:45 +0100 Subject: =?UTF-8?q?Let=E2=80=99s=20try=20fixing=20bundler=20instead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of trying to work around the bug in bundler, what if we fixed it? --- script/rails-post-deploy | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index a2761ecbc..193d0bbec 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -80,28 +80,7 @@ then 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 install $bundle_install_options - touch .bundler-has-run -fi +bundle install $bundle_install_options if [ -n "$OPTION_THEME_URLS" ] then -- cgit v1.2.3 From 57bfe1f4fd19f766677e08b132d0a16fad2ad706 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Thu, 31 May 2012 12:06:42 +0100 Subject: =?UTF-8?q?Revert=20"Let=E2=80=99s=20try=20fixing=20bundler=20inst?= =?UTF-8?q?ead"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9f5ad85b6ff541a8e4dc83e91548af9c745d64af. --- script/rails-post-deploy | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index 193d0bbec..a2761ecbc 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -80,7 +80,28 @@ then bundle_install_options="--without development:test --deployment" fi -bundle install $bundle_install_options +# 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 install $bundle_install_options + touch .bundler-has-run +fi if [ -n "$OPTION_THEME_URLS" ] then -- cgit v1.2.3 From 3470fd45294f439dd5175f506684631e4c47cebe Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Thu, 31 May 2012 12:37:20 +0100 Subject: =?UTF-8?q?Revert=20"Revert=20"Let=E2=80=99s=20try=20fixing=20bund?= =?UTF-8?q?ler=20instead""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 57bfe1f4fd19f766677e08b132d0a16fad2ad706. In fact this time we are not going to try fixing bundler instead, but rather we are going to try to work around the bundler bug in a different way, by uploading our version of xapian-full to rubygems (under a different name: xapian-full-alaveteli). --- script/rails-post-deploy | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'script/rails-post-deploy') diff --git a/script/rails-post-deploy b/script/rails-post-deploy index a2761ecbc..193d0bbec 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -80,28 +80,7 @@ then 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 install $bundle_install_options - touch .bundler-has-run -fi +bundle install $bundle_install_options if [ -n "$OPTION_THEME_URLS" ] then -- cgit v1.2.3