在 RAILS 3 中设置巡航控制时出现问题

发布于 2024-12-03 01:44:08 字数 122 浏览 2 评论 0原文

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

I just setup cruise control on my server for my projects .
But now i am little bit confused how these rake task and capistrano work .
I tried lots of settings but still no success . If somebody help how to run all rake task and after successful build how can i deploy my application .

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冷情妓 2024-12-10 01:44:08

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

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

cap deploy

CruiseControl isn't supposed to deploy your app.

When you want to deploy your app (after many successful cruisecontrol tests against many commits to source control, you'll then:

cap deploy

谜兔 2024-12-10 01:44:08

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

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

https://[email protected]/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 = ['[email protected]'] #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 并保存,然后在项目配置文件中添加 project.build_command = './build_script.sh' /.cruise/projects/your_project/cruise_config.rb
现在一切都完成并且工作正常,但在第二种方法中,问题是如果构建也失败,那么您的代码也会部署到服务器。所以我认为这是一个不好的方法。
谢谢大家的帮助。

Ok guys thanks after looking into code i find out that we can deploy -:

1.Either you can use ccrb_cap_deployer.rb plugin to do so , but it is little bit buggy so i made some changes in the path and pushed the code into git again here

https://[email protected]/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

Now we had to add these two lines inside the project configuration file /.cruise/projects/your_project/cruise_config.rb

project.cap_deployer.emails = ['[email protected]'] #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

Also this plugin only let deploy the code into respective servers when the build is successful . Cheers

2.Second way is to create one shell script named it as build_script.sh to this path /.cruise/projects/your_project/work/

After that add

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

lines into the build_script.sh and save , Then add project.build_command = './build_script.sh' inside the project configuration file /.cruise/projects/your_project/cruise_config.rb
Now everthing done and works fine but in second method the problem is that if the build fails as well then also your code is deployed to server . SO i think that is a bad approach .
Thanks for help everyone.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文