2

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

4

2 回答 2

0

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

1.你可以使用ccrb_cap_deployer.rb插件来做到这一点,但它有点bug,所以我在路径中做了一些更改,并将代码再次推送到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.rb中添加project.build_command = './build_script.sh' 现在一切都完成并且工作正常,但在第二种方法中问题是如果构建也失败了,那么您的代码也会部署到 server 。所以我认为这是一个不好的方法。谢谢大家的帮助。

于 2011-09-10T12:01:14.153 回答
0

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

当您想要部署您的应用程序时(在针对许多源代码控制提交进行多次成功的巡航控制测试之后,您将:

cap deploy

于 2011-09-07T12:45:17.977 回答