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 |