什么是部署Perl应用程序的好方法? [英] What is a good way to deploy a Perl application?

查看:165
本文介绍了什么是部署Perl应用程序的好方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发布了这个问题寻找东西类似于Perl的 Buildout 。我认为 Shipwright 是我正在寻找的但我并不确定。我已经玩过了,我创建了一个项目,导入了我的所有源和依赖项,并将所有东西导出到一个容器,然后文件排序刚刚停止。我怎么做造船厂?我在船上做实际的开发工作,还是在造船厂进行开发?我假设该船仅用于部署,但是如何将船只部署到网络服务器(比如说我使用的是linux,apache和刚才运行的直接cgi)。

I posted this question looking for something similar to Buildout for Perl. I think Shipwright is what I'm looking for but I'm not really sure. I've played around with it and I created a project, imported all of my source and dependencies and I've exported everything to a vessel then the documentation sort of just stopped. What do I do with a shipyard vessel? Do I do my actual development work in the vessel, or do I do my development in the Shipyard? I'm assuming that the vessel is only for deployment, but how do I actually deploy a vessel to a web server (say I'm using linux, apache and just running straight cgi).

Shipwright是我正在努力完成的还是有其他更适合的东西?理想情况下,我可以使用Shipwright类似于我如何使用Buildout。我使用Buildout为我的开发创建一个很好的隔离环境,并且在部署到实时服务器来管理我的所有应用程序的依赖项时,我也使用Buildout。

Is Shipwright the right thing for what I'm trying to accomplish or is there something else that would be more appropriate? Ideally I could use Shipwright similar to how I use Buildout. I use Buildout to create a nice isolated environment for my development, and also I use Buildout when deploying to live servers to manage all of my application's dependencies.

编辑:我可以使用Buildout做的事情的重点是我想在Perl中做的。

Here are the highlights of what I can do with Buildout that I would like to be able to do in Perl.

使用Buildout,我的代码库中有一个列出依赖项的文件其中Perl将是CPAN模块或其他源存储库)。我可以运行一个引导脚本,它将获取所有这些依赖项,并将它们放入项目中的目录中,不将它们安装在系统级别。 Buildout还创建了可以执行任何操作的实用程序脚本(运行测试,其他命令行工具,任何事情),这些脚本显式地将依赖关系添加到路径,以便在我的脚本运行时,我的所有依赖项都可以导入。

With Buildout, I have a file in my codebase that lists dependencies (which for Perl would either be CPAN modules or other source repositories). I can run a bootstrap script that will fetch all of those dependencies and drop them into a directory within my project and NOT install them at a system level. Buildout also creates utility scripts which can do anything you want (run tests, other command line tools, anything really) and those scripts explicitly add the dependencies to the path so that as my scripts are running all of my dependencies are available to be imported.

这真的非常好,它允许我管理我的依赖关系,而无需在系统级别安装任何东西。这使得从一个版本变为另一个非常容易。此外,它允许我使用不同版本的同一模块在同一系统上运行多个Buildout项目。最后,一个巨大的好处是,使用Buildout的目录结构,我可以提交依赖关系到源代码控制,并部署到一个新的机器上,我只需要做一个结帐,我的所有依赖项都已经满足了,而无需触摸任何安装在一个系统级别。

What this really does very well is that it allows me to manage my dependencies without having to ever install anything at a system level. Which makes changing from one version to another very easy. Also, it allows me to have multiple Buildout projects running on the same system using different versions of the same module. Finally, one huge benefit is that with Buildout's directory structure, I can just commit the dependencies to source control and to deploy to a new machine I just need to do a checkout and all of my dependencies are already satisfied without having to touch anything installed at a system level.

推荐答案

我不认为你会发现完全像Perl中的Buildout,但是你可以放在一起一些事情会做的伎俩。

I don't think you'll find anything exactly like Buildout in Perl, but you could put together a couple of things that would do the trick.

您可以使用标准Build.PL脚本 Module :: Build 用于管理您的依赖关系并运行测试等命令。

You could use a standard Build.PL script for Module::Build for managing your dependencies and having commands to run tests, etc.

然后,您可以使用 cpanminus 将这些依赖项安装到本地(非系统)目录中。

Then you could use cpanminus to do the installation of those dependencies into a local (non-system) directory.

然后,您可以使用Shipwright使用这些现在的本地依赖关系对项目进行捆绑和部署。

Then you might be able to use Shipwright to do the bundling and deployment of the project with these now-local dependencies.

这篇关于什么是部署Perl应用程序的好方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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