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 |