Fixed cap deploy file for Passenger; added migration to create an admin user
[depot.git] / config / deploy.rb
1 set :application, "depot"
2 set :repository, "http://scripts.njae.me.uk/svn/m8rails/#{application}/branches/stable"
3
4 # If you aren't deploying to /u/apps/#{application} on the target
5 # servers (which is the default), you can specify the actual location
6 # via the :deploy_to variable:
7 set :deploy_to, "/var/www/depot.njae.me.uk/"
8
9 # If you aren't using Subversion to manage your source code, specify
10 # your SCM below:
11 set :scm, :subversion
12 set :scm_username, 'neil'
13
14 role :app, "depot.njae.me.uk"
15 role :web, "depot.njae.me.uk"
16 role :db, "depot.njae.me.uk", :primary => true
17
18 # Have the spinner/spawner/reaper processes run as the default user
19 set :runner, nil
20
21 # Copy the database.yml file across, as it's not kept in the SVN repository
22 after "deploy:update_code" , :configure_database
23 desc "copy database.yml into the current release path"
24 task :configure_database, :roles => :app do
25 db_config = "#{deploy_to}/config/database.yml"
26 run "cp #{db_config} #{release_path}/config/database.yml"
27 end
28
29 # Define the user for running and stopping server sub-proceses (Mongrel, etc.)
30 # set :runner, :neil
31
32 ## As we're not running any other server processes (FastCGI, Mongrel, etc.),
33 ## we don't need to start and stop them.
34 #namespace :deploy do
35 # [:start, :stop, :restart].each do |t|
36 # desc "#{t} task is a no-op with mod_rails"
37 # task t, :roles => :app do ; end
38 # end
39 #end
40
41 ## Custom tasks for starting and restarting Mongrel cluster
42 #namespace :deploy do
43 # desc "start the mongrel cluster"
44 # task :start, :roles => :app do
45 # sudo "/usr/bin/mongrel_cluster_ctl start"
46 # end
47 #
48 # desc "stop the mongrel cluster"
49 # task :stop, :roles => :app do
50 # sudo "/usr/bin/mongrel_cluster_ctl stop"
51 # end
52 #
53 # desc "restart the mongrel cluster"
54 # task :restart, :roles => :app do
55 # sudo "/usr/bin/mongrel_cluster_ctl restart"
56 # end
57 #end
58
59 namespace :deploy do
60 task :start, :roles => :app do
61 end
62
63 task :stop, :roles => :app do
64 end
65
66 desc "Restart Application"
67 task :restart, :roles => :app do
68 run "touch #{release_path}/tmp/restart.txt"
69 end
70
71 # task :after_update_code, :roles => :app do
72 # run "rm -rf #{release_path}/public/.htaccess"
73 # end
74 end