Capistrano
时间:2010-07-15 来源:595959
http://help.github.com/capistrano/
#config/deploy.rb set :application, "app1" default_run_options[:pty] = true set :repository, "[email protected]:595959/app1.git" set :scm, :git # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` set :scm_passphrase, "p@ssw0rd" ssh_options[:forward_agent] = true set :user, "root" set :deploy_to, "/home/user1/app1.com" set :use_sudo, false role :web, "host.ip" # Your HTTP server, Apache/etc role :app, "host.ip" # This may be the same as your `Web` server ssh_options[:port] = 22 role :db, "host.ip", :primary => true # This is where Rails migrations will run namespace :deploy do %w(start stop restart).each do |action| desc "#{action} the Thin processes" task action.to_sym do find_and_execute_task("thin:#{action}") end end desc "Symlink shared configs and folders on each release." task :symlink_shared do run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" run "ln -nfs #{shared_path}/config/environment.rb #{release_path}/config/environment.rb" run "ln -nfs #{shared_path}/config/environments/development.rb #{release_path}/config/environments/development.rb" run "ln -nfs #{shared_path}/config/environments/test.rb #{release_path}/config/environments/test.rb" run "ln -nfs #{shared_path}/config/environments/production.rb #{release_path}/config/environments/production.rb" run "ln -nfs #{shared_path}/config/thin.yml #{release_path}/config/thin.yml" run "ln -nfs #{shared_path}/config/initializers/session_store.rb #{release_path}/config/initializers/session_store.rb" run "ln -nfs #{shared_path}/public/assets #{release_path}/public/assets" run "ln -nfs #{shared_path}/public/avatars #{release_path}/public/avatars" end end namespace :thin do %w(start stop restart).each do |action| desc "#{action} the app's Thin Cluster" task action.to_sym, :roles => :app do run "thin #{action} -c #{deploy_to}/current -C #{deploy_to}/current/config/thin.yml" end end end after 'deploy:update_code', 'deploy:symlink_shared'
相关阅读 更多 +