论坛首页 Ruby版 ruby

如何使用capistrano2.0自动化部署?

浏览 577 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (2) :: 隐藏帖 (0)
作者 正文
最后更新时间:2008-03-08
我在使用capistrano部署时候,出现下面的报错:请问大家怎么解决啊?不知道capistrano默认是怎么启动服务的?
 ** transaction: commit
  * executing `deploy:restart'
  * executing "sudo -p 'sudo password: ' -u app /var/www/myweb/current/script/process/reaper"
    servers: ["192.168.1.70"]
    [192.168.1.70] executing command
*** [err :: 192.168.1.70] sudo:
*** [err :: 192.168.1.70] no passwd entry for app!

我现在的ruby on rails是运行在lighttpd+FastCGI(是robbin大哥推荐的),请问如何用capistrano重启lighttpd呢?
我的lighttpd是通过脚本/etc/init.d/lighttpd restart重启的。
我是capistrano的初学者,希望大家多指点

另外大家有没有capistrano的教材呢?google出来的东西很多都是简单的入门。
   
最后更新时间:2008-03-08
http://www.javaeye.com/topic/168989

自己写一个管理fcgi进程的脚本,用capistrano去调用就好了,不需要去重起Lighttpd
   
0 请登录后投票
最后更新时间:2008-03-08
谢谢robbin大哥的指点!
对于capistrano,我是刚接触哈(但是现在又要求要用,郁闷)。
能不能给我一个简单点的调用脚本或者系统命令的例子呢?
   
0 请登录后投票
最后更新时间:2008-03-11
找到调用系统命令的方法了哈:
task :create_file_link, :roles => [:web,:app] do
  run "rm -rf #{deploy_to}/current/config/database.yml"
  run "ln -s #{deploy_to}/shared/database.yml #{deploy_to}/current/config/database.yml"    
end


但是今天又遇到一个问题,capistrano是通过ssh到server上去执行指令,但是发现我们有一台server的ssh端口是将默认的22修改成了3022,请问这个在deploy.rb中怎么配置这个端口呢?

set :user, "root"  
set :password, "password"
   
0 请登录后投票
最后更新时间:2008-03-12
找到方法设置port了,在deploy.rb中直接设置:
set :port, "7822"

但是郁闷的是,又发现新问题,如下:
[test@localhost ptree]$ cap deploy:setup
  * executing `deploy:setup'
  * executing "umask 02 && mkdir -p /home/efu/privatetree /home/efu/privatetree/releases /home/efu/privatetree/shared /home/efu/privatetree/shared/system /home/efu/privatetree/shared/log /home/efu/privatetree/shared/pids"
    servers: ["test.com"]
    [test.com] executing command
*** [err :: test.com] Unable to get term attr: Invalid argument
 ** [out :: test.com] [root@test2 /]#


用户名和密码都是对的,最后也出现了"[root@test2 /]",表示已经帐号是对的啊,但是就是报:Unable to get term attr: Invalid argument

大家遇到过这样的情况没有啊?帮帮忙啊
   
0 请登录后投票
论坛首页 Ruby版 ruby

跳转论坛:
JavaEye推荐