代码托管如何与暂存环境配合使用
到目前为止,我们一直在托管我们的 Mercurial 存储库,并通过 hgserve 直接相互拉取。代码经过审查后,QA 将其推送到我们的 webdev 服务器,该服务器充当临时环境。 (php web) 应用程序在投入生产之前会再次进行测试。
Hg 服务并不总是可靠的(比如当你想要从中拉取的服务器没有运行时!),所以我们正在考虑切换到代码托管(即 BitBucket)。因此,我们都会在那里拥有自己的帐户,并且 webdev 服务器也会有一个帐户...但是,在 QA 推送到 webdev 存储库后,更改如何返回到物理 webdev 服务器?有人登录服务器拉取吗?这听起来不对...
我的替代方案是根本不托管 webdev 服务器存储库,并且 QA 使用 ssh 直接推送到服务器 - 这是人们所做的吗?
我是这里的初学者,所以请随时纠正任何错误的假设,我非常感谢您的帮助!
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 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...
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的设置听起来不错。要将代码从主机获取到服务器,您可以
定期轮询存储库。只需每 10 分钟运行一次
hg pull --update
即可。这相当便宜,因为 Mercurial 会快速确定何时没有任何新内容可供拉取。从托管站点触发拉取。许多站点(包括 Bitbucket)允许您在将变更集推送到站点时运行一些操作。 Bitbucket 将这些操作称为“服务”。
它们提供与许多在线工具的集成,并且还有
Your setup sounds fine. To get the code from your host to your server, you can either
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.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".
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.