<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>wosmvp</title>
    <description></description>
    <link>http://wosmvp.javaeye.com</link>
    <language>UTF-8</language>
    <copyright>Copyright 2003-2008, JavaEye.com</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>JavaEye - 做最棒的软件开发交流社区</generator>
      <item>
        <title>Vlad the Deployer 配合 mod_rails 使用的文档</title>
        <author>wosmvp</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://wosmvp.javaeye.com">wosmvp</a>&nbsp;
          链接：<a href="http://wosmvp.javaeye.com/blog/211910" style="color:red;">http://wosmvp.javaeye.com/blog/211910</a>&nbsp;
          发表时间: 2008年07月05日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          作者: wosmvp /wosmvp@gmail.com<br />日期: 2008/7/2<br />最初发表于：http://www.ruby-lang.org.cn<br /><br /><br />1. 测试环境:<br />   1. Web服务器的URL： DreamHost提供<br />     svn版本:1.4.2<br />   2. SVN服务器的URL: Google Code提供<br />   3. 测试机环境:<br />     系统:Ubuntu-7.10-amd64<br />     svn版本:1.4.4<br />     Vlad the Deployer版本号: 自编译版 1.2.0.1 (2008/7/1日取源码)<br /><br />2. 使用方法:<br />   1) 安装Vlad the Deployer<br />      下载 Vlad the Deployer 源码<br />      git clone git://github.com/aussiegeek/vlad.git<br />      打包代码为gem文件<br />            gem build vlad.gemspec <br />        安装 Vlad the Deployer<br />            gem install vlad-1.2.0.1.gem -l<br /><br />   2) 添加mod_rails支持<br />     在Rakefile中添加<br />      require 'vlad'<br />      Vlad.load :app => 'passenger'<br /><br />   3) 修改配置<br />      配置文件为config/deploy.rb ，一个基本可以运行的deploy.rb修改<br />      set :domain,  "用户名@WEB服务器"<br />      set :deploy_to, "在WEB服务器上的位置，如 /home/username/web "<br />      set :repository, "SVN服务器"<br /><br />      本例中使用的deploy.rb：<br />      set :svn_cmd, "svn --username 用户名 --password 密码"<br />      set :domain,  "***@www.***.com"<br />      set :deploy_to, "程序位置"<br />      set :repository, "Google svn地址"<br />   4) 服务器端配置:<br />      略<br /><br /><br />   5) 包含的Rake任务:<br />      rake vlad:cleanup  # Clean up old releases.<br />      rake vlad:debug  # Show the vlad setup.<br />      rake vlad:invoke  # Invoke a single command on every remote server.<br />      rake vlad:migrate  # Run the migrate rake task for the the app.<br />      rake vlad:rollback # Rolls back to a previous version and restarts.<br />      rake vlad:setup  # Setup your servers.<br />      rake vlad:setup_app # Prepares application servers for deployment.<br />      rake vlad:start  # (Re)Start the web and app servers<br />      rake vlad:start_app # Restart PassengerVlad.load :app => 'passenger'<br />      rake vlad:start_web # (Re)Start the web servers<br />      rake vlad:stop   # Stop the web and app servers<br />      rake vlad:stop_web # Stop the web servers<br />      rake vlad:update  # Updates your application server to the latest revision.<br /><br />   例如：<br />        rake vlad:update vlad:migrate vlad:start_app<br />     该命令代表的含义为更新后，再进行migrate ,然后重新启动WEB服务器<br /><br /><br />3. 其它注意事项:<br />   1) 使用其它版本管理工具,例如git,需修改Rakefile<br />      require 'vlad'<br />      Vlad.load :scm => :git<br /><br />   2) SVN需要用户名,密码<br />      在deploy.rb中设定Vlad the Deployer<br />      set :svn_cmd, "svn --username 用户名 --password 密码"<br /><br />   3) 简化命令的使用<br />   vlad采用的是Rake命令,可进行如下简化等:<br />      rake vlad:update vlad:migrate vlad:start_app <br />      修改为<br />      task 'easyupdate'=> ['vlad:update', 'vlad:migrate','vlad:start_app']<br /><br />      然后可以通过<br />            rake easyupdate<br />        来执行<br />            rake vlad:update vlad:migrate vlad:start_app<br />        命令<br />        <br />   4) 以下为所有可以设定的系统变量<br />      == Core Variables<br /><br />      repository::    REQUIRED: Repository path: e.g. http://repo.example.com/svn<br />      deploy_to::    REQUIRED: Deploy path on target machines. e.g. /var/www/app<br />      domain::     REQUIRED: Used for the common case of a single target<br />             server. e.g. example.com<br />      current_path::   The full path on the remote host that will be symlinked<br />             as 'current'. Defaults to "#{deploy_to}/current".<br />      current_release::  The full path to the current release's actual location.<br />             Defaults to "#{releases_path}/#{releases.last}".<br />      deploy_timestamped:: Create timestamped release directories instead of using<br />             revision numbers. Defaults to true.<br />      deploy_via::    Which SCM command should be used when deploying the app.<br />             Defaults to "export".<br />      latest_release::   The most recent release, which may not yet have been<br />             symlinked. Defaults to release_path.<br />      migrate_args::   Set this to change the RAILS_ENV that 'rake db:migrate'<br />             will run under. Defaults to "".<br />      migrate_target::   Set this if you need to specify a particular migration<br />             'VERSION' number. Defaults to "latest".<br />      rails_env::    Specifies the RAILS_ENV environment variable that will<br />             be used. Defaults to "production".<br />      rake::      Set this if you need to specify an alternate path to<br />             'rake'. Defaults to "rake".<br />      release_name::   Name of the release directory, if deploy_timestamped is<br />             true. Defaults to timestamp: "YYYYMMDDHHMMSS".<br />      release_path::   Path to this release, which may not have been created<br />             yet. Defaults to "#{releases_path}/#{release_name}".<br />      releases::     An array of all existing releases, oldest first.<br />             Defaults to latest release directory name.<br />      releases_path::   Full path to the 'releases' directory on the remote host.<br />             Defaults to "#{deploy_to}/releases".<br />      revision::     Revision to use for release. Defaults to 'head'.<br />      rsync_cmd::    Path to rsync command. Defaults to "rsync".<br />      rsync_flags::    Flags for rsync. Defaults to ['-azP', '--delete'].<br />      scm_path::     Path on the remote host that will be used as 'working<br />             space' for SCM tasks. Defaults to "#{deploy_to}/scm".<br />      shared_path::    Full path to remote 'shared' directory, symlinked into<br />             your app by default. Defaults to "#{deploy_to}/shared".<br />      ssh_cmd::     Path to ssh. Defaults to "ssh".<br />      ssh_flags::    Flags for ssh. Defaults to "".<br />      sudo_cmd::     Path to sudo command. Defaults to "sudo".<br />      sudo_flags::    Flogs for sudo. Defaults to nil.<br />      sudo_password::   Asks for password when referenced.<br />      umask::      Sets your umask value. Defaults to "02".<br /><br />      == Apache Web Variables:<br /><br />      web_command::    Command to execute when controlling the web server.<br />             Defaults to "apachectl".<br /><br />      == Mongrel App Variables:<br /><br />      mongrel_address::   Defaults to "127.0.0.1"<br />      mongrel_clean::   Defaults to false<br />      mongrel_command::   Defaults to 'mongrel_rails'<br />      mongrel_conf::    Defaults to "#{shared_path}/mongrel_cluster.conf"<br />      mongrel_config_script:: Defaults to nil<br />      mongrel_environment:: Defaults to "production"<br />      mongrel_group::   Defaults to nil<br />      mongrel_log_file::  Defaults to nil<br />      mongrel_pid_file::  Defaults to nil<br />      mongrel_port::    Defaults to 8000<br />      mongrel_prefix::   Defaults to nil<br />      mongrel_servers::   Defaults to 2<br />      mongrel_user::    Defaults to nil<br /><br />      == Perforce SCM Variables:<br /><br />      p4_cmd::      The perforce command to use. Defaults to "p4"<br />      source::      A perforce SCM worker instance.<br /><br />      == Subversion SCM Variables:<br /><br />      source::      A subversion SCM worker instance.<br />      svn_cmd::     The subversion command to use. Defaults to "svn"<br /><br />      == Git - The Distributed SCM<br /><br />      git_cmd::     The git command to use. Defaults to "git"
          <br/>
          <span style="color:red;">
            <a href="http://wosmvp.javaeye.com/blog/211910#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 05 Jul 2008 19:01:27 +0800</pubDate>
        <link>http://wosmvp.javaeye.com/blog/211910</link>
        <guid>http://wosmvp.javaeye.com/blog/211910</guid>
      </item>
  </channel>
</rss>