如何从 Hudson 调用的 perl 脚本调用 ant

发布于 2024-12-01 02:41:50 字数 319 浏览 2 评论 0原文

Hudson 允许我们指定我们想要使用的 ant 版本。现在,我想做的是让 Hudson 调用我的 perl 脚本,然后该脚本将调用 ant。我该怎么做?

当我尝试从 Hudson 调用的 perl 脚本调用 ant 时,出现以下错误:

Can't exec "ant": No such file or directory at ...........

我知道此错误意味着“ant”不在路径中。问题是,如果我提供确切的位置或将 ant 添加到路径中,则意味着我没有使用我从 Hudson 指定的 ant。

有人可以帮忙吗?

Hudson allows us to specify the ant version that we want to use. Now, what I want to do is having Hudson call my perl script which then will call ant. how do I do this?

When I tried to call ant from perl script that was called from Hudson, I got the following error:

Can't exec "ant": No such file or directory at ...........

I understand that this error means "ant" is not in the path. The thing is that if I provide the exact location or add ant to the path, then that means I am not using ant that I specified from Hudson.

Can anyone help?

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

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

发布评论

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

评论(1

臻嫒无言 2024-12-08 02:41:50

看起来您实际上并不希望调用 ant 作为 Hudson 构建步骤,如果您将其添加为构建步骤,则会发生这种情况。如何将其设置为 ANT_VERSION 参数化选项,并带有以下选项:/opt/apache-ant-1.8.0、/opt/apache-ant-xyz 等。然后在执行 Shell 构建步骤中执行以下操作:

my-perl-script.pl --ant-version=${ANT_VERSION}

您的脚本将 ant 版本的路径作为参数。

It looks like you don't actually want to invoke ant as a Hudson build step which will happen if you add it as a build step. How about making it a parameterized Choice as ANT_VERSION with options: /opt/apache-ant-1.8.0, /opt/apache-ant-x.y.z, etc. Then in your Execute Shell build step do:

my-perl-script.pl --ant-version=${ANT_VERSION}

where your script takes the path to the ant version as a paramter.

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