在RAILS 3中设置巡航控制的问题

时间:2011-09-06 11:20:55

标签: ruby-on-rails ruby cruisecontrol cruisecontrol.rb

我只是在我的服务器上为我的项目设置巡航控制。 但现在我有点困惑这些佣金任务和capistrano如何工作。 我尝试了很多设置,但仍然没有成功。如果有人帮助如何运行所有rake任务,并且在成功构建之后我如何部署我的应用程序。

2 个答案:

答案 0 :(得分:0)

CruiseControl不应该部署你的应用程序。

当你想要部署你的应用程序时(经过许多成功的巡航控制测试,对许多提交来源控制,你就会:

cap deploy

答案 1 :(得分:0)

好的伙计们在查看代码后发现我们可以部署 - :

1.您可以使用ccrb_cap_deployer.rb插件来执行此操作,但它有点儿错误,所以我在路径中进行了一些更改并将代码再次推送到git中

https://vparihar01@github.com/webonise/cruisecontrol.git 
# in mean time I add some more plugins and features . Also add the wiki for proper step how to setup cruise control server and how make it customize as per your need

现在我们必须在项目配置文件 /。cruise / projects / your_project / cruise_config.rb

中添加这两行。
project.cap_deployer.emails = ['asda@fsdfsfsdfs.com'] #here add the email to notify given user if deployment is successful or not 
project.cap_deployer.stages = ['staging','production'] #here add the where you want to deploy test , staging or production

此插件只允许在构建成功时将代码部署到各自的服务器中。干杯

2.第二种方法是在此路径中创建一个名为 build_script.sh 的shell脚本 /。cruise / projects / your_project / work /

之后添加

  #!/bin/bash
  # conditionally install project gems from Gemfile
  bundle check || bundle install || exit 1
  cap deploy

进入build_script.sh并保存,然后在项目配置文件 /。cruise / projects / your_project / cruise_config中添加 project.build_command ='。/ build_script.sh'。 RB
现在完成并且工作正常,但在第二种方法中,问题是如果构建失败,那么您的代码也会部署到服务器。所以我认为这是一个糟糕的方法。 感谢大家的帮助。