Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- default_run_options[:pty] = true
- #set :scm_username, Proc.new{ Capistrano::CLI.password_prompt('SVN User: ') }
- #set :scm_password, Proc.new { Capistrano::CLI.password_prompt('SVN Password: ') }
- set :application, "myapp"
- set :domain, "localhost"
- set :repository, "svn+ssh://#{domain}/var/www/apps/#{application}/repos/trunk"
- set :deploy_to, "/var/www/apps/#{application}"
- # If you aren't deploying to /u/apps/#{application} on the target
- # servers (which is the default), you can specify the actual location
- # via the :deploy_to variable:
- # set :deploy_to, "/var/www/#{application}"
- # If you aren't using Subversion to manage your source code, specify
- # your SCM below:
- # set :scm, :subversion
- role :app, "localhost"
- role :web, "localhost"
- role :db, "localhost", :primary => true
- set :mongrel_conf, "#{current_path}/config/mongrel_cluster.yml"
- desc "Restart apache"
- task :restart_apache, :roles => :app do
- sudo "/etc/init.d/apache2 reload"
- end
- # Capistrano 2.0 doesn't work with the mongrel recipes, so we need to override the defaults ourselves.
- namespace :deploy do
- namespace :mongrel do
- [ :stop, :start, :restart ].each do |t|
- desc "#{t.to_s.capitalize} the mongrel appserver"
- task t, :roles => :app do
- #invoke_command checks the use_sudo variable to determine how to run the mongrel_rails command
- invoke_command "mongrel_rails cluster::#{t.to_s} -C #{mongrel_conf}", :via => run_method
- end
- end
- end
- namespace :memcached do
- [ :stop, :start, :restart ].each do |t|
- desc "#{t.to_s.capitalize} the memcached appserver"
- task t, :roles => :app do
- #invoke_command checks the use_sudo variable to determine how to run the memcached command
- sudo "/etc/init.d/memcached #{t.to_s}"
- end
- end
- end
- desc "Custom restart task for mongrel cluster"
- task :restart, :roles => :app, :except => { :no_release => true } do
- deploy.costum_tasks
- deploy.mongrel.restart
- end
- desc "Custom start task for mongrel cluster"
- task :start, :roles => :app do
- deploy.costum_tasks
- deploy.mongrel.start
- end
- desc "Custom stop task for mongrel cluster"
- task :stop, :roles => :app do
- deploy.mongrel.stop
- end
- desc "Memcached restart task"
- task :memcached_restart, :roles => :app do
- deploy.memcached.restart
- end
- desc "Memcached start task"
- task :memcached_start, :roles => :app do
- deploy.memcached.start
- end
- desc "Memcached stop task"
- task :memcached_stop, :roles => :app do
- deploy.memcached.stop
- end
- desc "Rake makemo"
- task :rake_makemo, :roles => :app do
- run "rake makemo"
- end
- desc "stop and start memcached ,migrate and rakedb tasks"
- task :costum_tasks, :roles => :app do
- deploy.memcached_stop
- deploy.migrate
- deploy.makemo
- deploy.memcached_start
- end
- #desc "Rake db migrate"
- #task :rake_db, :roles => :app do
- # run "rake db:migrate"
- #end
- #desc "Deploys d1g project"
- #task :deploy_d1g ,:roles => :app do
- #stoping mongrel
- #deploy.stop
- #
- #deploy.start
- #deploy.memcached_stop
- #deploy.memcached_start
- #end
- end
Add Comment
Please, Sign In to add comment