public
Description: Code used in the Intellectual Scalability Session at RailsConf Europe
Homepage:
Clone URL: git://github.com/fcheung/rails_conf_demo.git
fcheung (author)
Mon Sep 08 03:23:33 -0700 2008
commit  3909e985d7a9611f58770dbfa914bc15f448b0e2
tree    a050842f39800fef044a983114c7ac43bb5f59ff
parent  0cb449a9fdbbc622589f29e41130215db6e4d64e
rails_conf_demo / Rakefile
100644 32 lines (28 sloc) 0.664 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
APPS = %w(container content comment)
 
desc "Run the migrations in all the apps"
task :migrate_all do
  APPS.each do |app|
    Dir.chdir(app) do
      puts "migrating #{app}"
      `rake db:migrate`
    end
  end
end
 
desc "start all the servers"
task :start_all do
  APPS.each_with_index do |app, index|
    Dir.chdir(app) do
      puts "starting #{app} on port #{8000 + index}"
      puts `ruby script/server -d -p #{8000 + index}`
    end
  end
end
 
desc "stop all the servers"
task :stop_all do
  APPS.each_with_index do |app, index|
    Dir.chdir(app) do
      pid = IO.read('tmp/pids/mongrel.pid')
      Process.kill 'TERM', pid.to_i
    end
  end
end