OLD | NEW |
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 sudo bundle install --gemfile=$app_dir/Gemfile |
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 pushd $app_dir |
11 pushd "$tmp_dir" | 8 |
| 9 export GEM_HOME=~discourse/.gems |
12 bundle install | 10 bundle install |
| 11 |
13 rake assets:precompile RAILS_ENV="production" | 12 rake assets:precompile RAILS_ENV="production" |
| 13 |
| 14 [[ -f /etc/init.d/spawn-fcgi ]] && sudo /etc/init.d/spawn-fcgi stop |
| 15 |
| 16 rake db:migrate RAILS_ENV="production" |
| 17 |
| 18 [[ -f /etc/init.d/spawn-fcgi ]] && sudo /etc/init.d/spawn-fcgi start |
| 19 |
14 popd | 20 popd |
15 | |
16 # TODO: Stop Thin | |
17 | |
18 [[ -d $app_dir ]] && rm -rf "$app_dir" | |
19 mv "$tmp_dir" "$app_dir" | |
20 | |
21 pushd "$app_dir" | |
22 rake db:migrate RAILS_ENV="production" | |
23 popd | |
24 | |
25 # TODO: Start Thin | |
OLD | NEW |