在生产中使用web根目录下的git [英] Using git below web root in production

查看:115
本文介绍了在生产中使用web根目录下的git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个狂热的git用户;我在开发中使用git;在舞台上,但不在生产中。

在生产环境中,是否有任何理由不在web根目录下使用git(/ var / www /)?我一直在考虑使用主分支作为生产分支,或者创建一个生产分支。 推出制作大师的声音非常好听很好......但仍然有点错误。



在生产环境中,您需要关注:


  • 访问安全性(您如何复制/部署交付)

  • 停止应用程序的正确流程

  • 部署新版本

  • 启动正确的流程(按正确顺序)

  • 监控

  • li>


版本控制不是该图片的一部分:您可能希望在生产环境中安装的任何额外工具是一个额外的潜在故障点需要自己的管理和监控)。
除非它与您正在部署的应用程序(直接链接,因为您的应用程序无法在没有额外工具的情况下运行)直接链接,不应该在生产平台上。



制作 git archive 其中包含一个version.txt来标识归档已经完成的repo / SHA1,并将sftp / srsynch发送到生产平台。

从那里开始,不再需要Git了。


I'm an avid git user; I use git in development; in staging, but not in production.

Are there any good reasons not to use git below the web root (/var/www/) in a production environment? I've been considering either using the master branch as the production branch, or creating a production branch.

push production master sounds so nice...

解决方案

so nice... and yet so wrong somehow.

In production environment, you need to be concerned with:

  • access security (how do you copy/deploy a delivery)
  • stopping the right process of your app
  • deploying a new version
  • starting the right processes (in the right order)
  • monitoring
  • reporting

Version Control is not part of that picture: any extra tool you might want to install in a production environment is an extra potential failure point (and need administration and monitoring of its own).
Unless it has a direct link with the application you are deploying ("direct link" as in "your app won't work without that extra tool"), it shouldn't be on a production platform.

Make a git archive from your master branch as a nice tar archive, with a "version.txt" in it to identify the repo/SHA1 from which that archive has been done, and sftp/srsynch it to the production platform.
From there, no more Git needed.

这篇关于在生产中使用web根目录下的git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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