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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 scm_url="https://hg.adblockplus.org/discourse"
4 tmp_dir="/tmp/discourse-$$"
5 config_dir="/etc/discourse"
6 app_dir="/opt/discourse" 3 app_dir="/opt/discourse"
7 4
8 hg clone "$scm_url" "$tmp_dir" 5 cd $app_dir
9 ln -s "$config_dir/database.yml" "$tmp_dir/config/database.yml" 6
10 ln -s "$config_dir/redis.yml" "$tmp_dir/config/redis.yml" 7 export GEM_HOME=~discourse/.gems
11 pushd "$tmp_dir"
12 bundle install 8 bundle install
13 rake assets:precompile RAILS_ENV="production"
14 popd
15 9
16 # TODO: Stop Thin 10 $GEM_HOME/bin/rake assets:precompile RAILS_ENV="production"
17 11
18 [[ -d $app_dir ]] && rm -rf "$app_dir" 12 [[ -f /etc/init.d/spawn-fcgi ]] && sudo /etc/init.d/spawn-fcgi stop
19 mv "$tmp_dir" "$app_dir"
20 13
21 pushd "$app_dir" 14 $GEM_HOME/bin/rake db:migrate RAILS_ENV="production"
22 rake db:migrate RAILS_ENV="production"
23 popd
24 15
25 # TODO: Start Thin 16 [[ -f /etc/init.d/spawn-fcgi ]] && sudo /etc/init.d/spawn-fcgi start
OLDNEW
« 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