什么是好的代码部署策略?

发布于 2024-07-15 18:58:43 字数 374 浏览 5 评论 0原文

我正在开发一个 Django 项目。 我们的团队遵循敏捷实践(TDD、非常短的启动时间等)。

当涉及到功能的部署阶段时,我们遵循手动程序将代码部署到我们的生产机器上。 从某种意义上说,手动过程是手动运行(整个项目的)测试用例并手动运行syncdb(或任何最新的数据库更改)和其他内容。

这个手动操作每天大约需要 1/2 小时。 所以我想自动化这个。 那么是否有任何自动部署系统或其他系统可以接受我给出的命令并执行我想要的操作,或者只能手动完成? (使用一个简单的 shell 文件,其中包含我的所有命令。在这种情况下,我需要学习一点 shell 编程,因为如果任何测试用例失败,我不想更新生产机器中的最新代码。所以这样的排序存在部署条件,我猜这可能涉及一些 shell 编程!)

I am working on a Django project. And our team follows agile practices(TDD,very short launch times etc..)

When it comes to deployment stage of a feature, we follow manual procedures to get the code deployed on to our production machine. Manual procedures in the sense, run the test cases (of the entire project) manually and run the syncdb (or any latest db changes) manually and other stuff.

This manual stuff is taking about 1/2 hour per day,everyday. So I wanted to automate this. So is there any automatic deployement system or something that takes the commands I give and do what I want or it should be done only MANUALLY?? (using a simple shell file which has got all my commands. In which case, I need to learn shell programming a bit because I don't want to update my latest code in my production machine if any test case fails. So such a sort of conditions exist for deploying, which may involve a bit of shell programming. I guess!)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

葬心 2024-07-22 18:58:44

因此,用敏捷术语来说,您已经确定了部署过程中的重复,现在您正在寻找重构它的方法。 ;-)

在 Ruby/Rails 世界中,您首先会转向 CapistranoVlad The Deployer,在 Python/Django 世界中你会转向同等的东西,除了据我所知,没有'语气。

似乎来自 这篇文章 Capistrano 已成功用于处理 Django 部署,因此这是一个值得探索的选项。

除此之外,为什么需要 shell 编程? 你有一个超级强大的 Python 脚本语言 - 为什么不用它来自动化你的手动过程呢?

So in Agile terms, you've identified duplication in your deployment process, now you're looking for ways to refactor it. ;-)

In the Ruby/Rails world, you'd turn first to Capistrano or Vlad The Deployer, and in the Python/Django world you'd turn to the equivalent, except AFAIK there isn't one.

It seems from this post that Capistrano has been used successfully to handle Django deployment, so that's an option worth exploring.

Beyond that, why would you need shell programming? You have a super-powerful scripting language in Python - why not automate your manual process in that?

那小子欠揍 2024-07-22 18:58:43

我自己刚刚开始研究这个问题,看起来 Capistrano 的 Python 等价物是 Fabric,尽管也许没有那么成熟。 似乎有越来越多的人想要切换,只是因为 Capistrano 太以 ruby​​/rails 为中心,尽管我还没有看到有人抱怨 Capistrano 没有能力或缺乏。 YMMV。 更多信息此处此处

编辑:看起来 Fabric 正在经历很多变化。 他们正在将主页移至 http://docs.fabfile.org/

I just started researching this myself and it looks like the Python-equivalent of Capistrano is Fabric, although maybe not as mature. There seem to be a growing number of people wanting to switch over simply because Capistrano is too ruby/rails centric, although I haven't seen anyone complain about Capistrano being incapable or lacking. YMMV. More info here and here.

EDIT: Looks like Fabric is undergoing a lot of changes. They're moving their homepage to http://docs.fabfile.org/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文