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: Created Feb. 15, 2013, 9:29 p.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,20 @@
#!/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"
+sudo bundle install --gemfile=$app_dir/Gemfile
+
+pushd $app_dir
+
+export GEM_HOME=~discourse/.gems
bundle install
+
rake assets:precompile RAILS_ENV="production"
+
+[[ -f /etc/init.d/spawn-fcgi ]] && sudo /etc/init.d/spawn-fcgi stop
+
+rake db:migrate RAILS_ENV="production"
+
+[[ -f /etc/init.d/spawn-fcgi ]] && sudo /etc/init.d/spawn-fcgi start
+
popd
-
-# TODO: Stop Thin
-
-[[ -d $app_dir ]] && rm -rf "$app_dir"
-mv "$tmp_dir" "$app_dir"
-
-pushd "$app_dir"
-rake db:migrate RAILS_ENV="production"
-popd
-
-# TODO: Start Thin
« 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