简体   繁体   English

使用 Git 自动部署代码

[英]Automatic code deployment with Git

We use Beanstalk to manage Git repositories across multiple projects and participants (dev/designers) for PHP based projects.对于基于 PHP 的项目,我们使用 Beanstalk 跨多个项目和参与者(开发/设计人员)管理 Git 存储库。

While the local workflow is nice and smooth, we're hitting snags when it comes to getting changes deployed to the production website.虽然本地工作流程很好且流畅,但在将更改部署到生产网站时,我们遇到了困难。

We tried the 'Deployments' feature of Beanstalk, but it uses FTP, and is apt to take a while.我们尝试了 Beanstalk 的“部署”功能,但它使用的是 FTP,并且需要一段时间。 Sometimes if people push changes in rapid succession, the queue gets jammed up, and the wrong versions are sent out.有时,如果人们快速连续地推送更改,队列就会堵塞,并且会发送错误的版本。

What I am looking for is a way to simply have the production server do 'git pull' when pushes are sent to Beanstalk.我正在寻找的是一种在将推送发送到 Beanstalk 时让生产服务器执行“git pull”的方法。

I was investigating using Web Hooks, but was coming up short in getting that to work.我正在使用 Web Hooks 进行调查,但未能使其正常工作。

The best solution would be that code is pulled only when the latest push of changes are signed off on.最好的解决方案是仅在签署最新的更改推送时才提取代码。

How can I accomplish this?我怎样才能做到这一点?

Capistrano is not just for Ruby on Rails, you should check it out. Capistrano 不仅适用于 Rails 上的 Ruby,您应该检查一下。

http://www.jonmaddox.com/2006/08/16/automated-php-deployment-with-capistrano/ - is a short tutorial on doing automated deployments with PHP. http://www.jonmaddox.com/2006/08/16/automated-php-deployment-with-capistrano/ - 是关于使用 PHP 进行自动化部署的简短教程。

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

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