Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/discourse/files/init-discourse

Issue 9377123: Set up proper FastCGI environment for Discourse and use nginx (Closed)
Patch Set: Installing gems per user again Created Feb. 16, 2013, 8:33 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/discourse/files/discourse.fcgi ('k') | modules/discourse/files/intraforum.adblockplus.org » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/discourse/files/init-discourse
===================================================================
rename from modules/discourse/files/deploy-discourse
rename to modules/discourse/files/init-discourse
--- a/modules/discourse/files/deploy-discourse
+++ b/modules/discourse/files/init-discourse
@@ -1,25 +1,16 @@
#!/bin/bash
-scm_url="https://hg.adblockplus.org/discourse"
-tmp_dir="/tmp/discourse-$$"
-config_dir="/etc/discourse"
app_dir="/opt/discourse"
-hg clone "$scm_url" "$tmp_dir"
-ln -s "$config_dir/database.yml" "$tmp_dir/config/database.yml"
-ln -s "$config_dir/redis.yml" "$tmp_dir/config/redis.yml"
-pushd "$tmp_dir"
+cd $app_dir
+
+export GEM_HOME=~discourse/.gems
bundle install
-rake assets:precompile RAILS_ENV="production"
-popd
-# TODO: Stop Thin
+$GEM_HOME/bin/rake assets:precompile RAILS_ENV="production"
-[[ -d $app_dir ]] && rm -rf "$app_dir"
-mv "$tmp_dir" "$app_dir"
+[[ -f /etc/init.d/spawn-fcgi ]] && sudo /etc/init.d/spawn-fcgi stop
-pushd "$app_dir"
-rake db:migrate RAILS_ENV="production"
-popd
+$GEM_HOME/bin/rake db:migrate RAILS_ENV="production"
-# TODO: Start Thin
+[[ -f /etc/init.d/spawn-fcgi ]] && sudo /etc/init.d/spawn-fcgi start
« no previous file with comments | « modules/discourse/files/discourse.fcgi ('k') | modules/discourse/files/intraforum.adblockplus.org » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld