花了一個上午,將Capistrano佈署成功

 

要點:

  1. 只要在client機器上安裝capistrano即可,服務器不需要裝。
  1. 服務器要裝好rails環境和版本控制工具
  1. 儘量不要使用sudo, 用www的用戶即可,安全。

設置爲 set :use_sudo, false

以下是我的配置文件(deploy.rb)

set :application, "netbar_cap"

set :repository, "your igt"

default_run_options[:pty] = true

set :use_sudo, false

#set :scm_command, "/usr/local/src/git-1.6.0.4/git"

set :scm, :git

# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`

role :web, "wbfwzx.com"

# Your HTTP server, Apache/etc

role :app, "wbfwzx.com"

# This may be the same as your `Web` server

role :db, "wbfwzx.com", :primary => true # This is where Rails migrations will run

#role :db, "your slave db-server here"

set :deploy_to, "/home/xiao/#{application}"

set :mongrel_conf, "#{deploy_to}/current/config/mongrel_cluster.yml"

set :runner, "xiao"

set :user, "xiao"

on :start do

`ssh-add`

end

namespace :deploy do

task :restart do

restart_mongrel_cluster

end

end
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章