Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
650 views
in Technique[技术] by (71.8m points)

version control - Using git below web root in production

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...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...