如何管理您的 Perl 应用程序开发、构建和部署? [英] How do manage your Perl application development, build, and deployment?

查看:52
本文介绍了如何管理您的 Perl 应用程序开发、构建和部署?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还没有想出一种令人满意的方法来管理我的 Perl 应用程序的开发、构建和部署.我想听听您是如何解决这个问题的和/或您希望在您现在没有的应用程序构建系统中拥有什么.

I have yet to come up with a satisfactory way to manage the development, build, and deployment of my Perl applications. I'd like to hear how you have solved this problem and/or what you would like to have in an application build system that you don't have now.

请描述您的应用程序类型(它是 Web 应用程序,是在服务器上运行,还是使用 PAR 或 PerlApp 捆绑它以便您可以在无 perl 系统上运行).

Please describe your application type (is it a web app, does it run on a server, or do you bundle it using PAR or PerlApp so that you can run on perlless systems).

构建系统应提供的关键内容:

Key things a build system should provide:

  • 库的控制.
    • 应该可以将库分发版签出到我的 dev 目录中,以便在我的构建中使用它.
    • 使用将使用适当目录的 @INC 值执行 perl 应该很容易.
    • 应该可以从系统 perl 安装中获取模块列表.
    • Control of libraries.
      • It should be possible to check a library distribution out into my dev directory to use it in my build.
      • It should be easy to execute perl with an @INC value that will use the appropriate directories.
      • It should be possible to get a list of modules that are being sourced from the system perl install.
      • 只需发出一个 make test 或类似命令,就可以轻松地对整个应用程序进行全局测试.
      • It should be easy to do a global test across the entire application by issuing only one make test or similar command.
      • 结构不应干扰CVS、SVN等版本的正常使用控制系统.
      • 系统至少应在 Win32 和 Unix 派生系统上运行.
      • 理想情况下,工具在 perl 运行的所有地方都应该具有相同的功能.
      • 作为设置环境的一部分,应该没有必要将 perl 安装到特殊目录中.
      • 启动应用程序应该是一个自动化的过程.应该可以使用 Module::Starter 或 h2xs 之类的东西来布局基本结构并创建任何标准文件.

      交叉发布于 Perlmonks.

      Cross-posted at Perlmonks.

      推荐答案

      关于这个我可以写很多

      1. 库的控制 - 我只用我想要的模块创建我自己的 CPAN 版本.App::Cpan 的最新版本具有多项功能,例如 -j 选项来加载一次性配置,以帮助解决这个问题.一旦你有了它,你就可以将它分发到一个拇指驱动器或 CD 上,其中包含所有模块、CPAN.pm 配置以及你需要的一切.只需稍加编程,您就可以创建一个 run_me 脚本来实现这一切.

      1. Control of libraries - I create my own versions of CPAN with just the modules I want. The latest versions of App::Cpan has several features, such as the -j option to load one-time configurations, to help with this. Once you have this, you can distribute it on a thumb-drive or CD which has all of the modules, the CPAN.pm configuration, and everything else you need. With a little programming you create a run_me script that make it all happen.

      Makefile/Build 集成 - 我不集成 Makefile.那是通往灾难的道路.相反,我使用顶级应用程序模块进行集成测试,该模块也会自动测试其所有依赖项.-t 切换到 cpan 命令对于测试当前工作目录中的模块很有用:

      Makefile/Build integration - I don't integrate the Makefiles. That's the road to disaster. Instead, I do integration testing with the top-level application module, which automatically tests all of its dependencies too. The -t switch to the cpan command is useful to test the module in the current working directory:

      cpan -t .

      您也可以使用各种交互测试框架.您将 PERL5LIB 设置为空(硬编码的 @INC 目录中只有核心模块),因此 cpan 必须从头开始安装所有内容.

      There are various intergation testing frameworks that you can use too. You set PERL5LIB to something empty (with only have the core modules in the hard-coded @INC directories) so cpan has to install everything from scratch.

      1. 版本控制友好——你使用什么并不重要.大多数东西都有某种导出功能,您可以在没有源代码控制的情况下获得所有东西.Git 非常好,因为它在正常情况下只有最少的污染.

      1. Version control friendly - it doesn't much matter what you use. Most things have some sort of export where you can get everything without the source control stuff. Git is very nice because it only has a minimum of pollution in the normal cases.

      跨平台 - 我提到的所有内容都可以在 Windows 和 Unix 上正常运行.

      Cross platform - everything I've mentioned works just fine on Windows and Unix.

      单个 Perl 安装 - 这部分更棘手,我认为您走错了路.任何时候多个东西必须依赖同一个 perl,有人会为其他人搞砸.我绝对建议不要使用系统 Perl 进行应用程序开发,以免扰乱系统的运行.至少,每个应用程序都应将所有非核心模块安装到自己的目录中,以免与其他应用程序竞争.

      Single Perl install - this part is more tricky, and I think you're going in the wrong way. Any time multiple things have to depend on the same perl, someone is going to mess it up for the others. I definitely recommend not using the system Perl for application development just so you don't mess up the operation of the system. At the minimum, every application should install all non-core modules into their own directories so they don't compete with other applications.

      易于启动 - 这只是一个简单的编程问题.

      Easy start up - that's just a simple matter of programming.

      奖励:我不使用 Module::Starter.这是错误的方法,因为您必须依赖 Module::Starter 认为您应该做什么.我使用 Distribution::Cooker 它只是获取模板工具包模板的目录并将它们处理为给他们你的分发目录.你可以做任何你喜欢的事情.如何获得初始模板取决于您.

      BONUS: I don't use Module::Starter. It's the wrong way to go since you have to depend what Module::Starter thinks you should do. I use Distribution::Cooker which simply takes a directory of Template Toolkit templates and processes them to give them your distribution directory. You can do anything that you like. How you get the initial templates is up to you.

      这篇关于如何管理您的 Perl 应用程序开发、构建和部署?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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