简体   繁体   English

GIT-Web开发工作流程/部署

[英]GIT - Web Development workflow/deployment

I'm part of a team of 3 (2 developers and 1 designer) who sometimes work in the office and sometimes remotely and I'm looking at a way of using GIT to develop our websites seamlessly. 我是一个由3人(包括2个开发人员和1个设计师)组成的团队的成员,他们有时在办公室工作,有时在远程工作,我正在寻找一种使用GIT无缝开发我们的网站的方法。 I've got a managed account with Rackspace and have 3 servers setup on the account - development, staging and production. 我拥有Rackspace的客户帐户,并且在该帐户上设置了3台服务器-开发,暂存和生产。

I'm looking at the best way for our team to develop daily on our websites without having to FTP the files up to the server each time we make any changes. 我正在寻找一种最好的方式,使我们的团队每天在我们的网站上进行开发,而不必每次进行任何更改时都将FTP文件上传到服务器。 I've used SVN in the past but i'm looking to use Git for version control. 我过去使用过SVN,但我希望使用Git进行版本控制。 The workflow I had in mind for an example website called 'test' was the following: 我想到的一个名为“ test”的示例网站的工作流程如下:

Development Server would have a directory (called trunk but not sure if it should be called something else?) for each user as well as a central directory. 开发服务器将为每个用户都有一个目录(称为主干,但不确定是否应该将其称为其他名称?)以及一个中央目录。 Eg /var/www/test/jbloggs/, /var/www/test/asmith/, /var/www/test/rjohnson/ and /var/www/test/central/trunk/. 例如/ var / www / test / jbloggs /,/ var / www / test / asmith /,/ var / www / test / rjohnson /和/ var / www / test / central / trunk /。

The central repository would be installed within /var/www/test/central/trunk/ and then /asmith/, /rjohnson/ and /jbloggs/ would clone the trunk which would mean they would become /var/www/test/asmith/trunk, /var/www/test/rjohnson/trunk/ and /var/www/test/jbloggs/trunk/. 中央存储库将安装在/ var / www / test / central / trunk /中,然后/ asmith /,/ rjohnson /和/ jbloggs /将克隆主干,这意味着它们将成为/ var / www / test / asmith /主干,/ var / www / test / rjohnson / trunk /和/ var / www / test / jbloggs / trunk /。

Each user would then have a copy of /trunk/ which will contain all the website files, will all have a subdomain configured ie jbloggs.test.development, rjohnson.test.development etc and will configure their IDE to automatically SFTP to the server so that they are working directly within their directory the development server. 然后,每个用户都有一个/ trunk /的副本,其中将包含所有网站文件,都将配置一个子域,即jbloggs.test.development,rjohnson.test.development等,并将其IDE配置为自动SFTP到服务器,因此他们直接在开发服务器的目录中工作。 The central directory domain will be test.development. 中央目录域将为test.development。 When they come to committing any changes to the central repository they will SSH into the server and commit their changes and when we want to update the central repository we will pull these changes to get the latest version which can then be viewed at test.development. 当他们提交对中央存储库的任何更改时,他们将通过SSH进入服务器并提交其更改;当我们想要更新中央存储库时,我们将拉动这些更改以获得最新版本,然后可以在test.development上查看。

Is this the right method of doing things or should we all have a local LAMP stack installed (apart from the designer who uses Windows) and have our repositories locally? 这是正确的处理方法吗?还是我们都应该安装一个本地LAMP堆栈(除了使用Windows的设计人员),并在本地存储我们的存储库? If so, should the central repo still be on the rackspace server? 如果是这样,中央存储库是否仍应位于机架服务器上? The developers will be using phpstorm and the designer dreamweaver. 开发人员将使用phpstorm和设计师dreamweaver。

Hope the above makes sense. 希望以上是合理的。

Thanks 谢谢

I strongly advise you to work local and then commit on the shared server. 我强烈建议您在本地工作,然后在共享服务器上提交。 This is what git is made for. 这就是git的目的。 Development will be more reactive and easier for everybody. 每个人的发展都会更加被动,也更容易。 Make sure all dev master git so they can do their internal soup as they want. 确保所有开发大师git都可以按照自己的意愿做内部汤。 If one dev destroy the database, the others can keep on working. 如果一个开发人员破坏了数据库,其他开发人员可以继续工作。 But you'll also need a convenient way to synch databases so developers work with an up to date local database. 但是,您还需要一种方便的方式来同步数据库,以便开发人员使用最新的本地数据库。

The rest of your chain is ok, you can still have two test step like dev server for dev team and test server for testers. 其余的链都可以,您仍然可以有两个测试步骤,例如针对开发团队的开发服务器和针对测试人员的测试服务器。 This will make testers working on a more stable version and it will also make you test the upgrade process when you copy changes from dev server to test server. 这将使测试人员可以使用更稳定的版本,也可以在将更改从开发服务器复制到测试服务器时测试升级过程。 Lot of errors arise because of untested upgrade procedures. 由于未经测试的升级过程而导致许多错误。 You can updates changes on test and production server either by installing GIT on them or just using a simple script that will ftp changed files. 您可以通过在测试服务器和生产服务器上安装GIT来更新更改,也可以仅使用简单的脚本通过ftp更改文件来更新更改。 I don't like having git on a production server but this is a personal opinion. 我不喜欢在生产服务器上安装git,但这是个人观点。

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

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