简体   繁体   English

建立有效和有效的发展进程

[英]Setting up an efficient and effective development process

I am in the midst of setting up the development environment (PHP/MySQL) for my start-up. 我正在为我的初创公司设置开发环境(PHP / MySQL)。 We use three sets of servers: 我们使用三套服务器:

LIVE - the servers which provide the actual application TEST - providing a testing version before it is actually released DEV - the development servers LIVE - 提供实际应用程序测试的服务器 - 在实际发布DEV之前提供测试版本 - 开发服务器

The development servers run SVN with each developer checking out their local copy. 开发服务器运行SVN,每个开发人员都签出他们的本地副本。 At the end of each day completed fixes are checked in and then we use Hudson to automate our build process and then transfer it over to TEST. 在每天结束时检查完成的修复,然后我们使用Hudson自动化我们的构建过程,然后将其转移到TEST。 We then check the application still functions correctly using a tester and then if everything is fine move it to LIVE. 然后,我们使用测试仪检查应用程序是否仍能正常运行,然后如果一切正常,请将其移至LIVE。 I am happy with this process but I do have two questions: 我很满意这个过程,但我有两个问题:

  • How would you recommend we do local testing - as each developer adds new pages or changes functionality I want them to be able to test what they are doing. 您如何建议我们进行本地测试 - 因为每个开发人员添加新页面或更改功能,我希望他们能够测试他们正在做什么。 Would you just setup local Apache and a local database and have them test locally on their own machine? 您是否只需设置本地Apache和本地数据库并让它们在自己的机器上进行本地测试?

  • How would you recommend dealing with data layer changes? 您会如何建议处理数据层更改?

  • Is there anything else you would recommend doing to really make our development process as easy and efficient as possible? 您是否还有其他建议让我们的开发过程尽可能简单有效?

Thanks in advance 提前致谢

+1 to each developer running her own setup, complete with Apache and database. 每个开发人员运行自己的设置+1,完成Apache和数据库。

Keep the database schema under version control. 将数据库架构保持在版本控制之下。

Possibly you could keep (maybe in a separate repository) a small but representative set of data, in a test database. 可能您可以在测试数据库中保留(可能在单独的存储库中)一小组但有代表性的数据。 Each morning you check out the latest copy of this test database, and start hacking. 每天早上你查看这个测试数据库的最新副本,并开始黑客攻击。 When you change schemas, update your test data repository accordingly. 更改模式时,请相应地更新测试数据存储库。

Anyone doing development SHOULD have their own local environment. 任何进行开发的人都应该有自己的本地环境。 I use Mac so I run MAMP so that I can have my own LAMP environment local and independent of any other environment. 我使用Mac,所以我运行MAMP,以便我可以拥有自己的LAMP环境本地并且独立于任何其他环境。 This will also allow me to know that nobody else is changing / working on the same components I am and removes any possible confusion. 这也将让我知道没有其他人在改变/处理我所使用的相同组件并消除任何可能的混淆。 If you are a windows user, there are also easy to install local versions of the LAMP stack such as XAMP, etc. If you are running Linux as your desktop, you will most likely already know how to install LAMP for the flavor of Linux you are running. 如果您是Windows用户,也可以轻松安装LAMP堆栈的本地版本,如XAMP等。如果您将Linux作为桌面运行,您很可能已经知道如何安装LAMP以实现Linux的风格正在跑步。

The database schema version is a great idea. 数据库模式版本是个好主意。 It is what we use as well. 这也是我们使用的。 In addition to the schema under version control, we add a schema version table to the schema and keep it updated so we can quickly tell what version is in production/qa/dev when we need to compare. 除了版本控制下的模式之外,我们还将模式版本表添加到模式中并保持更新,以便我们可以在需要比较时快速告知生产/ qa / dev中的版本。

As for the data layer changes there are two things I would recommend. 至于数据层的变化,我会推荐两件事。

  1. Always create your migration path, forward and backward. 始终创建前进和后退的迁移路径。 This means that when you have the schema you want to put on production to upgrade an existing schema, you should always make it part of the release. 这意味着当您拥有要生产的模式以升级现有模式时,应始终将其作为发布的一部分。 A clear concise process for ALTERing the tables. 一个清晰简洁的过程来改变表格。 By the same token, you need to have a working and tested ROLLBACK version as well in case something goes wrong. 出于同样的原因,你需要有一个工作和测试的ROLLBACK版本,以防出现问题。

  2. What I have found helpful is using a backup of production to load on my local (or QA/DEV) so that I have the most up-to-date data / schema to play with without affecting production. 我发现有用的是使用生产备份加载到我的本地(或QA / DEV),以便我可以使用最新的数据/架构而不影响生产。 If you are not performing regular backups of production, maybe now is a good time to implement a policy. 如果您没有定期执行生产备份,那么现在可能是实施策略的好时机。 Then you will kill two birds with one stone. 然后你将一石二鸟。 You will have backups for any outage and a useful live schema with data you can load to test with on another machine. 您将拥有任何中断的备份和有用的实时模式,其中包含可以加载以在另一台计算机上进行测试的数据。 This will also lend itself to raising any possible issues with schema changes as the data will be matching production. 这也将有助于提出架构更改可能出现的任何问题,因为数据将匹配生产。 So if it works locally (and on DEV/QA), it reduces the risk of something going wrong in production. 因此,如果它在本地(以及DEV / QA)上运行,它可以降低生产中出现问题的风险。

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

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