使用 Git 自动部署代码
我们使用 Beanstalk 跨多个项目和基于 PHP 的项目的参与者(开发人员/设计人员)管理 Git 存储库。
虽然本地工作流程非常流畅,但在将更改部署到生产网站时我们遇到了障碍。
我们尝试了 Beanstalk 的“部署”功能,但它使用 FTP,并且很容易需要一段时间。有时,如果人们快速连续地推送更改,队列就会堵塞,并且会发送错误的版本。
我正在寻找的是一种在推送发送到 Beanstalk 时让生产服务器简单地执行“git pull”的方法。
我正在研究使用 Web Hooks,但未能使其发挥作用。
最好的解决方案是仅在最新的更改推送签署后才拉取代码。
我怎样才能做到这一点?
We use Beanstalk to manage Git repositories across multiple projects and participants (dev/designers) for PHP based projects.
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. 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.
I was investigating using Web Hooks, but was coming up short in getting that to work.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Capistrano 不仅仅适用于 Ruby on Rails,您应该检查一下。
http://www.jonmaddox.com/2006/ 08/16/automated-php-deployment-with-capistrano/ - 是有关使用 PHP 进行自动化部署的简短教程。
Capistrano is not just for Ruby on Rails, you should check it out.
http://www.jonmaddox.com/2006/08/16/automated-php-deployment-with-capistrano/ - is a short tutorial on doing automated deployments with PHP.