代码/ Web应用程序部署的最佳实践? [英] Best Practices for Code/Web Application Deployment?

查看:135
本文介绍了代码/ Web应用程序部署的最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很乐意听到有关如何将代码从开发服务器最佳地移动到生产服务器的想法。



一个gotcha列表,不要做这个列表


  1. 任何可帮助自动执行步骤的工具。给予这些文件列表


  2. 记录这些文件从dev到生产的部署


  3. 如果部署或应用程序以任何方式失败,则允许更容易回滚...


从来没有在一个有部署过程的公司,除了非常手动的ftp文件从开发到生产。



您在公司,部门,

谢谢...



是的,我是一个冷灌装程序员,但文件是文件,这应该是语言不可知的问题。

解决方案

好的,我会咬人的。这个问题的技术方面,其他答案已经涵盖。但真正的问题是流程问题。真正的重点应该是确保有意义的软件开发生命周期(SDLC) - 规划,开发,验证和部署。我会依次覆盖。你想要的是在每个阶段的可重复的活动。



规划



详细说明和记录要交付的内容。通常票或用户故事就足够了。有时,您可以像书面要求文档一样做得更多,客户可以登录,这些文档会翻译成各种工件,例如书写用例 - 最终你想要的是在电子系统中记录的东西,你可以将更改与代码相关联。 ...



发展



还记得电子系统吗?好。现在,当您对代码进行更改(您正在确认源代码控制权),您将这些更改与电子系统中的某些东西(通常是票证)相关联。我喜欢 Trac ,但也听说过有关 Atlassian's套件。这样可以可追踪性。所以你可以断言已经做了什么和如何。然后,您可以使用此系统和源代码控制来创建构建(所有需要更改的内容),标记 。更好的是,一个构建包含一切,因此它是一个独立的实体,可以轻松地部署在自己的实体上。 ...



验证



许多商店忽略的最重要的步骤 - 在自己的危险。在生产中发现的缺陷在修复时指数级更昂贵,当它们在进程的早期被发现时。验证通常是在许多商店中发生的唯一步骤 - 因此请确保您的



不应完成程序员!这就像狐狸看着鸡舍。而正在做的是应该遵循某种计划。我们使用测试链接。这意味着每个版本都以相同的方式验证,因此您可以识别回归错误。而且,此版本的部署方式应与您在生产中一样。



如果一切顺利(通常至少需要3个版本),则版本已验证。这是...



部署



这应该是一个非事件,按照与在测试中所做的相同步骤进行验证生成。可以首先遇到临时服务器,其中有一个自动复制过程,但重点是,这不应该是一个问题,在这一点上,因为您验证了相同的过程。



结论



知道方面,您真正想要的是一种逻辑方式将更改分组在一起。这是一个构建的想法。它是真正的单位,应该在SDLC中的步骤之间。如果你已经有了,那么了解给定系统的状态的能力变得微不足道。


I would love to hear ideas on how to best move code from development server to production server.

A list of gotcha's, don't do this list would be helpful.

Any tools to help automate the steps of.

  1. Make backups of existing code, given these list of files

  2. Record the Deployment of these files from dev to production

  3. Allow easier rollback if deployment or app fails in any way...

I have never worked at a company that had a deployment process, other than a very manual, ftp files from dev to production.

What have you done in your companies, departments, etc?

Thank you...

Yes, I am a coldfusion programmer, but files are files, and this should be language agnostic question.

解决方案

OK, I'll bite. There's the technology aspect of this problem, which other answers have already covered. But the real issue is a process problem. Where the real focus should be ensuring a meaningful software development life cycle (SDLC) - planning, development, validation, and deployment. I'll cover each in turn. What you want is a repeatable activity at each phase.

Planning

Articulating and recording what's to be delivered. Often tickets or user stories are enough. Sometimes you do more, like a written requirements document, that a customer signs off on, that's translated into various artifacts such as written use cases - ultimately what you want though is something recorded in an electronic system where you can associate changes to code with it. Which leads me to...

Development

Remember that electronic system? Good. Now when you make changes to code (you're committing to source control right?) you associate those change with something in this electronic system - typically tickets. I like Trac, but have also heard good things about Atlassian's suite. This gives you traceability. So you can assert what's been done and how. Then you can use this system and source control to create a build - all the bits needed for whatever's changed - and tag that build in source control - that's your list of what's changed. Even better, have a build contain everything, so that it's standalone entity that can easily be deployed on it's own. The build is then delivered for...

Validation

Perhaps the most important step that many shops ignore - at their own peril. Defects found in production are exponentially more expensive to fix then when they're discovered earlier in the process. And validation is often the only step where this occurs in many shops - so make sure yours does it.

This should not be done by the programmer! That's like the fox watching the hen house. And whoever is doing is should be following some sort of plan. We use Test Link. This means each build is validated the same way, so you can identify regression bugs. And, this build should be deployed in the same way as you would into production.

If all goes well (we usually need a minimum of 3 builds) the build is validated. And this goes to...

Deployment

This should be a non-event, because you're taking a validated build following the same steps as you did in testing. Could be first it hits a staging server, where there's an automated copying process, but the point being is that is shouldn't be an issue at this point, because you validated with the same process.

Conclusion

In terms of knowing what's where, what you really want is a logical way to group changes together. This is where the idea of a build comes in. It's really the unit that should segue between steps in the SDLC. If you already have that, then the ability to understand the state of a given system becomes trivial.

这篇关于代码/ Web应用程序部署的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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