Rails w/ HopToad —— 部署?
我有一个已部署的 Rails 应用程序,我想将其与 Hoptoad(在线异常通知服务)一起使用。它打包在我安装在部署服务器上的 gem 中,但每次部署时我都需要运行脚本/生成 hoptoad 来配置它,因为 Hoptoad 配置文件/更改仅存在于我的生产应用程序中(而不存在于我的开发中) ,所以当我部署时,它们都会被删除)。
每次部署时是否有一种简单的方法可以在生产服务器上运行该脚本/生成?我觉得你可以用 Capistrano 任务来做到这一点,但我不知道该怎么做。
人们通常为此做什么?抱歉,如果这篇文章有点难以理解,我不太确定如何解释这个问题。
谢谢!
I have a deployed Rails application that I'd like to use with Hoptoad (an online exception notification service). It comes packaged in a gem that I installed on my deployment server, but I need to run the script/generate hoptoad every time I deploy to configure it because the Hoptoad config files/changes exist only on my production application (and not on my development, so when I deploy, they all get erased).
Is there an easy way to run that script/generate on the production server every time I deploy? I feel like you could do this with Capistrano tasks, but I don't know how to do that.
What do people usually do for this? Sorry if this post is a little hard to understand, I'm not quite sure how to explain the issue.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将 Hoptoad 配置文件添加到源代码存储库,以便将其作为 Rails 应用程序的一部分进行部署。
您可以将
或者,如果您不希望存储库中包含该信息,请将配置文件上传到您的生产服务器(在 Capistrano 的正常
releases
目录结构之外),并让 Capistrano 创建一个符号链接它作为部署过程的一部分。我提供了一个 答案到这里的一个类似问题应该会给你一个想法。You can add the Hoptoad configuration file to your source code repository so that it gets deployed as part of the Rails application.
Alternatively, if you don't want that information within your repository, then upload the config file to your production server (outside of Capistrano's normal
releases
directory structure) and have Capistrano create a symbolic link to it as part of the deployment process. I provided an answer to a similar question here which should give you the idea.