本文介绍了代码托管如何在暂存环境中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我们所有人都托管着我们的软件仓库,并通过hg服务直接从彼此之间拉取.审查代码后,质量检查将其推送到我们的webdev服务器,该服务器充当暂存环境. (php web)应用程序在投入生产之前再次经过测试.

Up until now, we've all been hosting our mercurial repositories and pulling directly from each other with hg serve. After code is reviewed, QA pushes it to our webdev server, which functions as the staging environment. The (php web) application is tested once again there before it goes to production.

Hg服务并不总是可靠的(例如,当您要从不运行的服务器拉出时!),因此我们正在考虑切换到代码托管(即BitBucket).因此,我们所有人都将在其中拥有自己的帐户,而webdev服务器也将具有一个帐户...但是,在质量检查推送到Webdev存储库后,更改如何将其返回到物理Webdev服务器?有人登录服务器拉他们吗?听起来不对...

Hg serve is not always reliable (like when the server you want to pull from isnt running!), so we are thinking to switch to code hosting (ie BitBucket). So, we would all have our own accounts there, and the webdev server would have an account as well... But, after QA pushes to the webdev repo, how do the changes make it back to the physical webdev server? Does someone log in to the server to pull them? That doesn't sound right...

我的选择是根本不托管webdev服务器存储库,而质量检查直接通过ssh推送到服务器-这是人们的工作吗?

The alternative I had is the webdev server repo not being hosted at all, and QA pushing directly to the server with ssh - Is this what people do?

我是这里的初学者,请随时纠正任何错误的假设,非常感谢您的帮助!

I'm a beginner here, so feel free to correct any wrong assumptions, and I really appreciate your assistance!

推荐答案

您的设置听起来不错.要将代码从主机获取到服务器,您可以

Your setup sounds fine. To get the code from your host to your server, you can either

  • 定期轮询存储库.每10分钟运行一次hg pull --update即可.这很便宜,因为Mercurial会迅速确定何时没有什么新东西要拉.

  • Periodically poll the repository. Simply running hg pull --update every 10 minutes will work. This is quite cheap since Mercurial will quickly determine when there's nothing new to pull.

从托管站点触发拉动.许多站点(包括Bitbucket)使您可以在将变更集推送到站点时执行一些操作. Bitbucket将这些操作称为服务" .

Trigger a pull from the hosting site. Many sites (including Bitbucket) let's you run some action when a changeset is pushed to the site. Bitbucket calls these actions "services".

它们提供了与许多在线工具的集成,并且还具有您可以使用的常规POST服务.启用它后,当推送变更集时,Bitbucket会简单地与您选择的网址联系.然后,您应该在该位置创建一个脚本,该脚本在调用脚本时将在服务器上运行hg pull --update.

They offer integration with many online tools and they also have a generic POST service which you can use. when you enable it, Bitbucket will simply contact a web address of your choice when a changeset is pushed. You should then create a script at that location that will run hg pull --update on your server when the script is invoked.

这篇关于代码托管如何在暂存环境中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 00:30