|
| 1 | +set :application, "api" |
| 2 | +set :repository, "file:///var/svn/#{application}/trunk/" |
| 3 | +set :local_repository, "svn+ssh://rubyforge.org/var/svn/#{application}/trunk" |
| 4 | + |
| 5 | +set :deploy_to, "/var/www/gforge-projects/api/" |
| 6 | +set :copy_strategy, :export |
| 7 | +set :user, "tom" |
| 8 | +set :group, "api" |
| 9 | +set :runner, "tom" |
| 10 | +set :use_sudo, false |
| 11 | + |
| 12 | +server "rubyforge.org", :app, :web |
| 13 | +role :db, "rubyforge.org", :primary => true |
| 14 | + |
| 15 | +def run_remote_rake(rake_cmd) |
| 16 | + run "cd #{current_path} && /usr/local/bin/rake RAILS_ENV=production #{rake_cmd}" |
| 17 | +end |
| 18 | + |
| 19 | +namespace :deploy do |
| 20 | + desc "Restarting mod_rails with restart.txt" |
| 21 | + task :restart, :roles => :app, :except => { :no_release => true } do |
| 22 | + run "touch #{current_path}/tmp/restart.txt" |
| 23 | + end |
| 24 | + |
| 25 | + [:start, :stop].each do |t| |
| 26 | + desc "#{t} task is a no-op with mod_rails" |
| 27 | + task t, :roles => :app do ; end |
| 28 | + end |
| 29 | +end |
| 30 | + |
| 31 | +task :move_in_database_yml, :roles => :app do |
| 32 | + run "cp #{deploy_to}/shared/system/database.yml #{current_path}/config/" |
| 33 | +end |
| 34 | + |
| 35 | +after "deploy:symlink", "move_in_database_yml" |
| 36 | +#after "deploy", "deploy:migrate" |
| 37 | +#after "deploy", "deploy:cleanup" |
| 38 | + |
| 39 | +desc "Tail the production log" |
| 40 | +task :tail, :roles => :app do |
| 41 | + run "tail -f #{shared_path}/log/production.log" do |channel, stream, data| |
| 42 | + puts # for an extra line break before the host name |
| 43 | + puts "#{channel[:host]}: #{data}" |
| 44 | + break if stream == :err |
| 45 | + end |
| 46 | +end |
0 commit comments