BASH脚本在Jenkins构建期间失败,但在本地不会失败

发布于 2025-02-08 06:05:41 字数 575 浏览 4 评论 0原文

我一直在尝试整天调试这个问题,但没有成功。

问题:BASH脚本在Linux Centos7 VM(Jenkins Build Agent)上成功执行,但在Jenkins Build期间失败。

这是简单的脚本。

#! /bin/bash
echo "before beyond compare command"
bcompare @"bc_report.ps1" "./Output_Base/<Folder_Name>" "./Output_Compare/<Folder Name>" "Report.html"
echo "after beyond compare command"

Jenkins构建日志中的输出仅是:

before beyond compare command
after beyond compare command

在詹金斯构建期间查看VM时,我没有看到生产工件。 Jenkins构建期间的用户是根源,当在本地执行脚本时,我也将其作为成功的根源。

我很确定这是詹金斯的问题,似乎无法弄清楚。有人看过类似的东西吗?

I've been trying to debug this issue all day with no success.

Issue: Bash script executes successfully on a Linux CentOS7 VM (jenkins build agent) but fails during Jenkins build.

Here's the simple script.

#! /bin/bash
echo "before beyond compare command"
bcompare @"bc_report.ps1" "./Output_Base/<Folder_Name>" "./Output_Compare/<Folder Name>" "Report.html"
echo "after beyond compare command"

The output in the Jenkins build log is just:

before beyond compare command
after beyond compare command

When viewing the VM during the Jenkins build, I'm not seeing an artifact being produced. The user during the Jenkins build is Root, when executing the script locally, I'm also doing so as Root with success.

I'm pretty sure this is a Jenkins issue, just can't seem to figure it out. Anyone seen something similar?

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

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

发布评论

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

评论(1

何时共饮酒 2025-02-15 06:05:41

除了比较4的Linux,即使对于脚本,也需要运行X-Window/GUI会话。作为CRON的作业或在没有X-Window客户端的SSH终端中,Linux脚本的不超越将无法运行。这可能是导致您的Jenkins工作失败的原因。

除了比较4的Windows 4没有脚本的GUI会话要求。除了比较Linux和MacOS的4之外,都需要脚本的GUI会话。删除在Linux和MacOS上脚本的GUI会话要求在未来版本的功能请求列表中。

Beyond Compare 4 for Linux requires an X-Window/GUI session to run, even for scripts. As a cron job or in an SSH terminal without an X-Window client, Beyond Compare for Linux scripts will fail to run. This might be what is causing your Jenkins job to fail.

Beyond Compare 4 for Windows doesn't have the GUI session requirement for scripts. Beyond Compare 4 for Linux and macOS both require a GUI session for scripts. Removing the GUI session requirement for scripting on Linux and macOS is on the feature request list for a future version.

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