简体   繁体   English

使用Git等维护网站

[英]Maintaining website with Git and more

I have a static website filled with documentation and reference material for my team and future users (we're up in coming, shown here with me trying to setup a useful and viable website system). 我有一个静态网站,里面满是文件和参考资料,供我的团队和未来的用户使用(我们来了,在此显示,试图建立有用且可行的网站系统)。

The site contains various static pages (note: by static I just mean HTML documents) in various directories that together are packages of documentation, or project homepages/documentation. 该站点在各个目录中包含各种静态页面(请注意:静态,我只是指HTML文档),这些目录共同构成了文档包或项目主页/文档。

I would like each project homepage or notable collection of pages/documentation to be a git repository. 我希望每个项目主页或页面/文档的显着集合都是git存储库。 The repositories should only be able to be pushed to by project maintainers and selective people, but should be able to be cloned by anyone (so users can quickly clone a documentation repository or something). 该存储库只能由项目维护人员和有选择的人员推入,但应该可以被任何人克隆(以便用户可以快速克隆文档存储库或其他内容)。 This eliminates FTP and similar annoying things. 这消除了FTP和类似的烦人的事情。

So with this goal I have a couple of issues: 因此,出于这个目标,我有两个问题:

  • What do I use to determine who can push to these repositories? 如何确定哪些人可以推送到这些存储库?
  • The website is on a HDD mounted to /hdd1 how do I make it, its contents, and any added contents readable by apache and readable and writable by git without having to change the permissions of the entire directory every time. 该网站位于安装到/ hdd1的HDD上,如何制作它,其内容以及apache可读,git可读和可写的所有添加内容,而不必每次都更改整个目录的权限。 (Note: It's a Linux box (Ubuntu Server)) (注意:这是Linux机器(Ubuntu服务器))

You need three kind of repositories. 您需要三种存储库。

  • A cental bare repository for doing the access control. 一个用于进行访问控制的中央裸仓库。
  • A non-bare one on your web server, pulling changes from the central one, updating the web site Web服务器上的一个非裸机,从中央服务器拉取更改,更新网站
  • working copies for the contributers, where changes are made and pushed to the central repository. 贡献者的工作副本,在那里进行更改并将其推送到中央存储库。

For the central repository I would recommend some management/authentication software like gitlab, gitolite, atlassian stash, gerrit, etc. 对于中央存储库,我建议使用一些管理/身份验证软件,例如gitlab,gitolite,atlassian储藏库,gerrit等。

For updating your repository at the web server you could use a git hook at the central repository. 要在Web服务器上更新存储库,可以在中央存储库使用git hook。

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

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