ruby-on-rails – 使用Passenger部署rails应用程序的最快方法

我正在使用Rails 2.3.5开发Dreamhost服务器.

每次我对网站进行更改时,我都必须ssh进入网站,删除所有文件,上传包含该网站所有新文件的zip文件,解压缩该文件,迁移数据库,然后继续.

有些东西告诉我有一种更快的方式来部署rails应用程序.我正在使用mac Time Machine来跟踪我的应用程序的不同版本.我知道git跟踪文件,但我真的不知道如何使用它来部署我的应用程序,因为乘客为我照顾所有的魔力.

什么是更快的部署我的应用程序的方式(并避免在我删除服务器上的所有文件时与我的方法相关的停机时间)?

谢谢!

解决方法

然后去找自己的Capistrano助手: http://github.com/westarete/capistrano-helpers

这是我自己网站的简化注释部署文件.

require 'capistrano-helpers/branch'     # prompts for branch
require 'capistrano-helpers/passenger'  # Support for Apache passenger
require 'capistrano-helpers/version'    # Record the version number after deploying
require 'capistrano-helpers/privates'   # handle sensitive files
require 'capistrano-helpers/shared'

set :application,"site"
set :repository,"file://."

set :scm,"git"
set :branch,"rails3"
set :deploy_via,:copy

set :copy_exclude,[ ".git","assets","test","Capfile","vishvish.tmproj","bin" ]

set :deploy_to,"/blah/blah.com/#{application}"

set :user,"blah"
set :domain,"blah.com"

#Things you want symlinked afterwards,not in version control.
set :privates,%w{
  config/database.yml
}

#Things you want shared across deployments,not uploaded every time.
set :shared,%w{
  uploads
}

role :app,domain
role :web,domain
role :db,domain,:primary => true

namespace :deploy do
  desc "Restarting mod_rails with restart.txt"
  task :restart,:roles => :app,:except => { :no_release => true } do
    run "touch #{current_path}/tmp/restart.txt"
  end

  [:start,:stop].each do |t|
    desc "#{t} task is a no-op with mod_rails"
    task t,:roles => :app do ; end
  end
end

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...