简体   繁体   English

无需使用git(hub)1个编码器+ 1个webdesigner的本地开发服务器即可进行Web应用程序开发的工作流程

[英]Workflow for webapplication development without local development servers using git(hub) 1 coder + 1 webdesigner

I am a programmer and in near future I am going to work together with a web/template designer on several projects. 我是一名程序员,在不久的将来,我将与Web /模板设计师一起在多个项目上合作。 What do you think about my development workflow setup? 您如何看待我的开发工作流程设置? Do you have any optimization tips? 您有任何优化技巧吗?

Setup for one specific project 设置一个特定项目

  • The whole project is hosted on github. 整个项目托管在github上。
  • The project is a complex webapplication running on a linux os (It's impossible to run it on a local development-server, neither on windows nor on mac). 该项目是一个运行在linux操作系统上的复杂Web应用程序(不可能在Windows和Mac上的本地开发服务器上运行它)。
  • There are 2 branches: dev and master. 有2个分支:dev和master。 dev is the testing server and master is the productive server. dev是测试服务器,而master是生产服务器。
  • Besides from the main github repository there is a local repository on the designer's computer, one on my computer, one on the testserver and one on the production server. 除了主要的github存储库之外,在设计者的计算机上还有一个本地存储库,一个在我的计算机上,一个在测试服务器上,一个在生产服务器上。
  • I develop locally (on Windows). 我在本地开发(在Windows上)。 While developing there is a auto-sync script that automatically uploads all files I edit via FTP to the testing server, so I can check instantly if my changes work. 在开发过程中,有一个自动同步脚本可以自动将我通过FTP编辑的所有文件上传到测试服务器,因此我可以立即检查所做的更改是否有效。
  • The designer also develops locally (on Mac), he will also have an auto-sync script that automatically uploads all his changes to the testserver via FTP, but he has just access to a special "layout"-directory where all templates and static files (images, css, js, ...) are located. 设计人员还进行本地开发(在Mac上),他还将拥有一个自动同步脚本,该脚本可以通过FTP自动将所有更改上传到测试服务器,但是他只能访问一个特殊的“布局”目录,其中包含所有模板和静态文件(图片,css,js等)位于。 He also needs to check every few minutes if his changes or new features work. 他还需要每隔几分钟检查一次自己的更改或新功能是否有效。
  • Whenever the designer or me sucessfully finished and tested a new feature on the testserver we then push our changes from the local dev-branch to the remote dev-branch on github. 每当设计人员或我成功完成并在测试服务器上测试新功能时,我们就将更改从github上的本地dev分支推送到github上的远程dev分支。 The testing server is not touched by git so far. 到目前为止,git还没有碰到测试服务器。
  • Everyday in the morning there is a cronjob, that deletes the whole testserver directory and then does a "git clone" of the dev-branch of the remote repository hosted on github. 每天早上都有一个cronjob,它将删除整个testserver目录,然后对github上托管的远程存储库的dev分支进行“ git clone”。 That way the testserver has all new commits. 这样,测试服务器将拥有所有新提交。
  • The designer and me have to "git pull" the newest updates of each other using the remote github repository every morning before any further development. 设计师和我必须每天早上使用远程github存储库“ git pull”彼此的最新更新,然后再进行进一步的开发。
  • As soon as a feature runs well on the testserver I will merge the "dev" branch to "master" and commit the master to github. 一旦功能在测试服务器上运行良好,我就将“ dev”分支合并到“ master”,并将master提交到github。
  • Then we have a deployment that pulls the master branch from github to the production server. 然后,我们进行了一个部署,将master分支从github拉到生产服务器。

Questions 问题

How do you generally handle the situation where you cannot have local development-servers for each project-member (because the application is not able run locally)? 您通常如何处理每个项目成员都不能拥有本地开发服务器的情况(因为该应用程序无法在本地运行)? It seems really unprofessional to have one testserver where everybody can upload files via ftp to try their stuff, because it can easily happen that someone overwrites someone elses files so testing will fail. 拥有一个测试服务器,每个人都可以通过ftp上传文件来尝试他们的东西,似乎真的很不专业,因为有人很可能会覆盖别人的文件,从而导致测试失败,这很容易发生。 Is there a best-practice example of how to develop in a team when there is no local testing server? 没有本地测试服务器时,是否有一个最佳实践示例,说明如何在团队中进行开发?

Thanks in advance for you help and sorry about my english, its not my native language. 在此先感谢您的帮助,对于我的英语(不是我的母语)感到抱歉。

Git is a distributed version control system, so it works best when everyone who is working on the project has their own development environment in which they can work with. Git是一个分布式版本控制系统,因此,当每个在项目上工作的人都有自己可以使用的开发环境时,它会发挥最佳作用。 I don't personally recommend using Git for a project where you are actually testing the app on a single server. 我个人不建议在实际在单个服务器上测试应用程序的项目中使用Git。 I recommend that you use a centralized version control system like Subversion . 我建议您使用集中式版本控制系统,例如Subversion Unfortunately by using subversion you won't be able to host the repository on Github (you'd have to use a system like Git-SVN which would get a bit complex) 不幸的是,通过使用Subversion,您将无法在Github上托管存储库(您必须使用类似Git-SVN的系统,这会变得有些复杂)

I would do this the following way: 我将通过以下方式执行此操作:

  1. Central repo hosted on github 托管在github上的中央仓库
  2. Each team member has a local virtual machine running, managed by Vagrant . 每个团队成员都有一个由Vagrant管理的本地虚拟机。
  3. There is a staging/testing server this sits at the HEAD of the dev branch. 在dev分支的HEAD处有一个登台/测试服务器。
  4. There is a production server this sits at the HEAD of the master branch. 有一个生产服务器,它位于master分支的HEAD处。

When ever you start work on a new feature you make a branch based on master. 每当您开始使用新功能时,都将基于master创建分支。 Once it is working as expected on your local machine you can commit it and merge it into dev and push to github. 一旦它在本地计算机上按预期工作,您可以提交它并将其合并到dev中并推送到github。 Its usually good to have a hook that updates the test server each time new code is pushed. 拥有一个钩子通常在每次推送新代码时更新测试服务器通常是一件好事。

Once the feature has passed testing you could merge the feature branch into master and push that to your production environment. 功能通过测试后,您可以将功能分支合并到master中,并将其推送到您的生产环境中。

If you want to fomalise the process around creating features, merging to branches and doing tagged releases etc then git-flow is a good option. 如果您想围绕创建功能,合并到分支以及执行带标签的发布等流程,那么git-flow是一个不错的选择。

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

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