使用hg存储库作为网站 [英] Using hg repository as web site

查看:81
本文介绍了使用hg存储库作为网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这与我的安全性问题此处有关.使用hg/Mercurial资源库创建实时网站是个坏主意吗?如果是这样,为什么?

This is somewhat related to my security question here. Is it a bad idea to use an hg / mercurial repository for a live website? If so, why?

此外,我们还有网站的开发,测试和生产安装,例如dev.example.comtest.example.comwww.example.com.如果在现场/生产网站上使用存储库不是一个好主意,那么可以在开发和测试站点上使用hg存储库吗?

Furthermore, we have dev, test and production installations of our website, like dev.example.com, test.example.com and www.example.com. If it's a bad idea to use a repository for a live/production website, would it be OK to use an hg repository for the dev and test sites?

我还担心易于部署.我们有技术人员和技术含量较低的同事将与该站点一起工作.技术人员(软件工程师)在使用命令行或TortoiseHG时不会有任何问题.我更关心技术含量较低的人(网页设计师).他们将无法在命令行上工作,甚至可能会发现TortoiseHG令人生畏.这些同事大多将.css文件和图像上载到服务器.我希望这些文件(至少是.css文件)受版本控制,但我希望这对非技术团队成员尽可能透明.

I'm also concerned about ease of deployment. We have technical and less technical co-workers who will be working with the site. The technical people (software engineers) won't have any problem working with the command line or TortoiseHG. I'm more concerned about the less technical people (web designers). They won't be comfortable working on the command line, and may even find TortoiseHG daunting. These co-workers mostly upload .css files and images to the server. I'd like for these files (at least the .css files) to be under version control, but I want this to be as transparent as possible for the non technical team members.

实现此目标的最佳方法是什么?

What's the best way to achieve this?

我们的站点"实际上是一个具有主存储库和几个子存储库的多站点CMS设置.存储库结构的模拟:

Our 'site' is actually a multi-site CMS setup with a main repository and several subrepositories. Mock-up of the repository structure:

/root [main repository containing core files and subrepositories]
    /modules [modules subrepository]
    /sites/global [subrepository for global .css and .php files]
    /sites/site1 [site1 subrepository]
    ...
    /sites/siteN [siteN subrepository]

软件工程师将在rootmodulessites/global存储库中工作.较少技术人员(网页设计师)只能在site1 ... siteN子存储库中工作.

Software engineers would work in the root, modules and sites/global repositories. Less technical people (web designers) would work only in the site1 ... siteN subrepositories.

推荐答案

是的,这是个坏主意.

不要将您的存储库作为网站.这意味着签入但无法使用的内容将立即可用.这意味着意外签入(发生)也会实时反映(例如不属于该处的文档等).

Do not have your repository as your website. It means that things checked in, but unworking, will immediately be available. And it means that accidental checkins (it happens) will be reflected live as well (i.e. documents that don't belong there, etc).

实际上,我使用我编写的工具解决了这个概念"(将源代码控制作为部署)(其他一些公司现在也正在解决该主题,因此您将看到更多).我的是针对SVN的(目前),因此它不是特别重要;我提到它只是为了表明我之前已经考虑过这一点(虽然不是在存储库上;在这种情况下,工作副本的答案是相同的:最好将非版本化的免费"作为网站目录,并且自动(通过用户操作)将版本化"数据复制到该目录.

I actually address this "concept" however (source control as deployment) with a tool I've written (a few other companies are addressing this topic now, as well, so you'll see it more). Mine is for SVN (at the moment) so it's not particularly relevant; I mention it only to show that I've considered this previously (not on a Repository though; a working copy, in that scenario the answer is the same: better to have a non-versioned "free" are as the website directory, and automate (via user action) the copying of the 'versioned' data to that directory).

这篇关于使用hg存储库作为网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆