`
wosmvp
  • 浏览: 21372 次
  • 性别: Icon_minigender_1
  • 来自: 青岛
最近访客 更多访客>>
社区版块
存档分类
最新评论

Vlad the Deployer 配合 mod_rails 使用的文档

阅读更多
作者: wosmvp /wosmvp@gmail.com
日期: 2008/7/2
最初发表于:http://www.ruby-lang.org.cn


1. 测试环境:
   1. Web服务器的URL: DreamHost提供
     svn版本:1.4.2
   2. SVN服务器的URL: Google Code提供
   3. 测试机环境:
     系统:Ubuntu-7.10-amd64
     svn版本:1.4.4
     Vlad the Deployer版本号: 自编译版 1.2.0.1 (2008/7/1日取源码)

2. 使用方法:
   1) 安装Vlad the Deployer
      下载 Vlad the Deployer 源码
      git clone git://github.com/aussiegeek/vlad.git
      打包代码为gem文件
            gem build vlad.gemspec
        安装 Vlad the Deployer
            gem install vlad-1.2.0.1.gem -l

   2) 添加mod_rails支持
     在Rakefile中添加
      require 'vlad'
      Vlad.load :app => 'passenger'

   3) 修改配置
      配置文件为config/deploy.rb ,一个基本可以运行的deploy.rb修改
      set :domain,  "用户名@WEB服务器"
      set :deploy_to, "在WEB服务器上的位置,如 /home/username/web "
      set :repository, "SVN服务器"

      本例中使用的deploy.rb:
      set :svn_cmd, "svn --username 用户名 --password 密码"
      set :domain,  "***@www.***.com"
      set :deploy_to, "程序位置"
      set :repository, "Google svn地址"
   4) 服务器端配置:
      略


   5) 包含的Rake任务:
      rake vlad:cleanup  # Clean up old releases.
      rake vlad:debug  # Show the vlad setup.
      rake vlad:invoke  # Invoke a single command on every remote server.
      rake vlad:migrate  # Run the migrate rake task for the the app.
      rake vlad:rollback # Rolls back to a previous version and restarts.
      rake vlad:setup  # Setup your servers.
      rake vlad:setup_app # Prepares application servers for deployment.
      rake vlad:start  # (Re)Start the web and app servers
      rake vlad:start_app # Restart PassengerVlad.load :app => 'passenger'
      rake vlad:start_web # (Re)Start the web servers
      rake vlad:stop   # Stop the web and app servers
      rake vlad:stop_web # Stop the web servers
      rake vlad:update  # Updates your application server to the latest revision.

   例如:
        rake vlad:update vlad:migrate vlad:start_app
     该命令代表的含义为更新后,再进行migrate ,然后重新启动WEB服务器


3. 其它注意事项:
   1) 使用其它版本管理工具,例如git,需修改Rakefile
      require 'vlad'
      Vlad.load :scm => :git

   2) SVN需要用户名,密码
      在deploy.rb中设定Vlad the Deployer
      set :svn_cmd, "svn --username 用户名 --password 密码"

   3) 简化命令的使用
   vlad采用的是Rake命令,可进行如下简化等:
      rake vlad:update vlad:migrate vlad:start_app
      修改为
      task 'easyupdate'=> ['vlad:update', 'vlad:migrate','vlad:start_app']

      然后可以通过
            rake easyupdate
        来执行
            rake vlad:update vlad:migrate vlad:start_app
        命令
       
   4) 以下为所有可以设定的系统变量
      == Core Variables

      repository::    REQUIRED: Repository path: e.g. http://repo.example.com/svn
      deploy_to::    REQUIRED: Deploy path on target machines. e.g. /var/www/app
      domain::     REQUIRED: Used for the common case of a single target
             server. e.g. example.com
      current_path::   The full path on the remote host that will be symlinked
             as 'current'. Defaults to "#{deploy_to}/current".
      current_release::  The full path to the current release's actual location.
             Defaults to "#{releases_path}/#{releases.last}".
      deploy_timestamped:: Create timestamped release directories instead of using
             revision numbers. Defaults to true.
      deploy_via::    Which SCM command should be used when deploying the app.
             Defaults to "export".
      latest_release::   The most recent release, which may not yet have been
             symlinked. Defaults to release_path.
      migrate_args::   Set this to change the RAILS_ENV that 'rake db:migrate'
             will run under. Defaults to "".
      migrate_target::   Set this if you need to specify a particular migration
             'VERSION' number. Defaults to "latest".
      rails_env::    Specifies the RAILS_ENV environment variable that will
             be used. Defaults to "production".
      rake::      Set this if you need to specify an alternate path to
             'rake'. Defaults to "rake".
      release_name::   Name of the release directory, if deploy_timestamped is
             true. Defaults to timestamp: "YYYYMMDDHHMMSS".
      release_path::   Path to this release, which may not have been created
             yet. Defaults to "#{releases_path}/#{release_name}".
      releases::     An array of all existing releases, oldest first.
             Defaults to latest release directory name.
      releases_path::   Full path to the 'releases' directory on the remote host.
             Defaults to "#{deploy_to}/releases".
      revision::     Revision to use for release. Defaults to 'head'.
      rsync_cmd::    Path to rsync command. Defaults to "rsync".
      rsync_flags::    Flags for rsync. Defaults to ['-azP', '--delete'].
      scm_path::     Path on the remote host that will be used as 'working
             space' for SCM tasks. Defaults to "#{deploy_to}/scm".
      shared_path::    Full path to remote 'shared' directory, symlinked into
             your app by default. Defaults to "#{deploy_to}/shared".
      ssh_cmd::     Path to ssh. Defaults to "ssh".
      ssh_flags::    Flags for ssh. Defaults to "".
      sudo_cmd::     Path to sudo command. Defaults to "sudo".
      sudo_flags::    Flogs for sudo. Defaults to nil.
      sudo_password::   Asks for password when referenced.
      umask::      Sets your umask value. Defaults to "02".

      == Apache Web Variables:

      web_command::    Command to execute when controlling the web server.
             Defaults to "apachectl".

      == Mongrel App Variables:

      mongrel_address::   Defaults to "127.0.0.1"
      mongrel_clean::   Defaults to false
      mongrel_command::   Defaults to 'mongrel_rails'
      mongrel_conf::    Defaults to "#{shared_path}/mongrel_cluster.conf"
      mongrel_config_script:: Defaults to nil
      mongrel_environment:: Defaults to "production"
      mongrel_group::   Defaults to nil
      mongrel_log_file::  Defaults to nil
      mongrel_pid_file::  Defaults to nil
      mongrel_port::    Defaults to 8000
      mongrel_prefix::   Defaults to nil
      mongrel_servers::   Defaults to 2
      mongrel_user::    Defaults to nil

      == Perforce SCM Variables:

      p4_cmd::      The perforce command to use. Defaults to "p4"
      source::      A perforce SCM worker instance.

      == Subversion SCM Variables:

      source::      A subversion SCM worker instance.
      svn_cmd::     The subversion command to use. Defaults to "svn"

      == Git - The Distributed SCM

      git_cmd::     The git command to use. Defaults to "git"
分享到:
评论
2 楼 yawl 2008-09-08  
一直在用,挺好的.

不过也没有觉得比Capistrano简便多少,因为deploy脚本一般写好,基本都很少维护的.
1 楼 liuqiang 2008-09-08  
Vlad the Deployer貌似比Capistrano简单,不知道最近发展的如何

相关推荐

    tw_a4_vlad_zahariuc_dumitru_covali:Web技术主题下的项目

    tw_a4_dumitru_covali Web技术主题下的项目

    github的使用文档教程

    git是一个分布式的版本控制系统,最初有linux Tovalds编写,初衷是为了管理linux内核代码的管理...Git同样可以被诸如Capistrano和Vlad the Deployer这样的部署工具所使用。同样,eoe.cn客户端的源码也托管在github上。

    Levels_A_Vlad - MetaTrader 4脚本.zip

    使用V.B. Antonov (A_Vlad)方法进行计算,显示支撑/阻力的水平。

    Github for windows

    Git是一个分布式的版本控制系统,最初由Linus Torvalds编写,用作Linux内核代码的管理。在推出后,Git在其它项目中也取得了很大成功,尤其是...Git同样可以被诸如Capistrano和Vlad the Deployer这样的部署工具所使用。

    Multiple VLAD Encoding of CNNs for Image Classification

    they explore the multiplicity of VLAD encoding with the extension of three encoding algorithms. Moreover, they equip the spatial pyramid patch (SPM) on VLAD encoding to add spatial information to CNN ...

    Git权威指南视频教程

    Git是一个分布式的版本控制系统,最初由Linus Torvalds编写,用作Linux内核代码的管理。在推出后,Git在其它项目中也取得了很大成功,尤其是...Git同样可以被诸如Capistrano和Vlad the Deployer这样的部署工具所使用。

    VLAD 经典的PPT

    这是关于VLAD的最好的PPT了,是原作者搞的,看起来很容易理解。

    VLAD经典论文

    此文档是VLAD的经典论文:特征向量聚合。看什么不如看文章来的快。

    用卷积滤波器matlab代码-top_attention:“最受关注”的源代码

    ./vlad_w/vl_main.m:使用LDD运行'Weight-Vlad' 例子 高度关注的可视化。 来自亮区的LDD将被保留,而其他LDD将被过滤。 我们可以发现大多数删除的LDD属于背景。 VLAD和Weight-VLAD的比较。 左列显示原始图像。 中间...

    vlad_landing

    vlad_landing

    MALTAB VLAD图像匹配

    MALTAB程序,带例程图像和相应SIFT描述子,保证可用,具体见README,中科大数字图像分析作业,自己做的,慎重下载

    angular_Vlad_Druzjakin

    angular_Vlad_Druzjakin

    论文研究-基于改进VLAD算法的图像分类.pdf

    针对图像分类问题进行了研究,提出一种改进的局部聚合描述符(vector of locally aggregated descriptors,VLAD)算法以得到高效的图像特征表示。采用卷积神经网络提取图像的密集局部特征。正态分布式选取子集训练...

    论文研究-基于CNN与VLAD的人体行为识别研究 .pdf

    基于CNN与VLAD的人体行为识别研究,王冬雪,张磊,人体行为识别是很多实际应用中的关键技术,例如视频监控、人机交互、虚拟现实和视频检索等,所以智能的人体行为识别技术有着很高

    vlad:vlad图像处理算法

    vlad:vlad图像处理算法

    MATLAB为验证vlad算法生成许多图像

    用MATLAB在两张大图上按不同大小和步长切割许多图像并生成他们的中心点绝对坐标作为标签

    用PHP部署PHP。 受Capistrano和Vlad的启发。-PHP开发

    该项目的灵感来自Capistrano和Deployer Vlad,并且建立在Rake克隆版本Phake的顶部。 该项目来自Pomander一个轻型灵活的部署工具,用于部署Web应用程序。 该项目的灵感来自Capistrano和Deployer Vlad,并且建立在Rake...

    Outlook 2003 SideBar V2.02 Alpha

    The control now uses subclassing from Paul Caton (thanks Paul) And the cMemdc for drawing From Vlad Vissoultchev (Thanks Vlad) Awesome code From two very talented programmers. Take a look and tell me ...

    VLAD计算中心距离.py

    VLAD计算中心距离.py

Global site tag (gtag.js) - Google Analytics