简体   繁体   English

Rails为什么在你有git post-receive hook时使用capistrano?

[英]Rails why use capistrano when you have git post-receive hook?

I'm not familiar with Capistrano at all, I've just read some basic posts about configuring it. 我根本不熟悉Capistrano,我刚读了一些关于配置它的基本帖子。 But my question is why bother with Capistrano if you can deploy your Rails application files using a git post-receive hook? 但我的问题是,如果你可以使用git post-receive钩子部署你的Rails应用程序文件,为什么要打扰Capistrano呢?

What does Capistrano offer that the hook doesn't? Capistrano提供的钩子不是什么?

I was looking into automated ways of deploying my Rails apps without using FTP and came across both git hooks and Capistrano. 我正在研究在不使用FTP的情况下部署我的Rails应用程序的自动化方法,并且遇到了git hooks和Capistrano。

Or am I missing something? 或者我错过了什么?

Thanks. 谢谢。

Git hooks allow you to execute script related to the git repository on a given action. Git钩子允许您在给定的操作上执行与git存储库相关的脚本。

Capistrano allows you to administer your production deploys. Capistrano允许您管理生产部署。

A single call to 'cap deploy' will clone your master branch on your target machine, archive the previous release, precompile your assets, restart passenger. 单次调用“cap deploy”将在目标计算机上克隆主分支,归档先前版本,预编译资产,重新启动乘客。 Capistrano can also migrate your database, or execute any number of arbitrary commands you want on any server configured in your deploy.rb file. Capistrano还可以迁移您的数据库,或在deploy.rb文件中配置的任何服务器上执行您想要的任意数量的任意命令。

Go with Capistrano for deploying to app/db server environments, you will have no trouble finding help when you get a problem with a deploy. 与Capistrano一起部署到app / db服务器环境,当您遇到部署问题时,您将毫无困难地寻求帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM