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 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 |
OLD | NEW |