在 Hudson 中执行命令作为构建后操作

发布于 2024-08-14 03:57:37 字数 152 浏览 6 评论 0原文

我是哈德逊的新人。 我想在 Hudson 中执行“sourcecodeanalyzer”命令作为构建后操作来生成 html 报告。请让我知道这是否可能,如果是,请让我知道执行该命令的 Hudson 配置步骤。

您在这方面的最早回复将会非常有帮助。

提前致谢。

I am new in Hudson.
I would like to execute a 'sourcecodeanalyzer' command in Hudson as Post-build Actions to generate an html report. Please let me know is this at all possible, if yes let me know the Hudson configuration steps to execute the command.

Your earliest response in this regard will be extremely helpful.

Thanks in advance.

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

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

发布评论

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

评论(6

勿忘初心 2024-08-21 03:57:37

是的,这几乎肯定是可能的。

您需要将 Hudson 项目配置为具有运行源代码分析器的构建后操作或构建步骤。

您没有在问题中准确说明哪个分析器 - 可能 Hudson 已经为其安装了一个插件,在这种情况下,它可能会列在项目底部的“后”下的“配置”页面上构建操作。

如果没有,接下来检查是否有可用于尚未安装的分析器的插件。从 Hudson 主页面中选择管理 Hudson,然后选择管理插件,然后选择可用选项卡。如果有可用的插件,那么使用它绝对是个好主意,因为它们通常与 Hudson 本身集成得很好。

作为最后的手段,您必须配置构建步骤来运行分析器。配置项目,然后选择“添加构建步骤”。显示的下拉列表取决于您的环境(Windows 或 Linux),但应包含运行 shell 命令或批处理文件的功能。您可以在那里配置您的分析器。

(如果您正在构建 Windows Visual Studio 应用程序,我使用的更灵活的方法是使用 MSBuild 插件进行构建,并使用 MSBuild 脚本来构建应用程序,然后运行分析工具。这可以相当自动化一切:我的构建应用程序,构建验收测试数据库,运行验收测试并将结果 HTML 复制到从项目链接的页面。)

Yes, it is almost certainly possible.

You will need to configure the Hudson project to have either a post-build action or a build step that runs your source code analyzer.

You've not stated in your question precisely which analyzer - it may be that Hudson already has a plug-in installed for it, in which case it may be listed on the Config page for the project at the bottom under Post-build Actions.

If not, next check to see if there's a plug-in available for the analyzer that hasn't been installed. From the main Hudson page select Manage Hudson, then Manage Plugins, and choose the Available tab. If there is a plug-in available it's definitely a good idea to use it as they are generally very well integrated with Hudson itself.

As a last resort you'll have to configure a build step to run the analyzer. Configure the project, then choose "Add build step". The drop-down that appears depends on your environment (Windows or Linux) but should include the ability to run a shell command or batch file. You can configure your analyzer there.

(If you're building Windows Visual Studio applications, a more flexible way that I've used is to use the MSBuild plug-in for builds, and have an MSBuild script that builds the application and then runs analysis tools. This can automate pretty much everything: mine builds the application, builds an acceptance test database, runs the acceptance tests and copies the result HTML to a page linked from the project.)

却一份温柔 2024-08-21 03:57:37

您可以使用“执行 Shell”构建步骤创建一个新作业。在文本框中输入您要运行的命令。然后您所要做的就是通过选择:

“在构建其他项目后构建”来

触发此作业,并从列表中选择触发作业。

希望这有帮助!

You could create a new job with a "Execute Shell" build step. Type in the command you wish to run in the text box. Then all you have to do is trigger this job by selecting:

"Build after other projects are built"

And select the trigger job from the list.

Hope this helps!

你在我安 2024-08-21 03:57:37

作为杰里米帖子的后续。如果您看不到添加构建后步骤的功能,您可能会使用 Maven 作业。在这种情况下,您需要 Hudson M2 Extra Steps 插件。这将为您提供构建前和构建后的步骤。

As a follow up to Jeremy's post. If you don't see the ability to add post build steps, you might work with maven jobs. In that case you need the Hudson M2 Extra Steps Plugin. This will give you pre and post build steps.

何时共饮酒 2024-08-21 03:57:37

我使用“构建后任务”插件在构建后删除一些资源。您可以调用任何 shell 脚本或命令行。如果您愿意,您可以根据某些日志记录输出进行调用。

I use the 'Post build task' plugin to delete some resources after a build. You could call any shell script or command lines. If you want you could make the call depends on some logging output.

呆橘 2024-08-21 03:57:37

有一种最佳方法可以解决此问题:

  1. 升级到 Fortify SCA 2.6.x(截至撰写本文时,最新版本为 2.6.5)。
  2. https://customerportal.fortify.com 下载 Fortify Maven 插件版本 2.6 并将其安装到您的 Hudson 服务器中Maven 存储库。
  3. 更新项目的 pom 以执行 Fortify 扫描。 Maven 插件提供了一个示例。

there is one best way to solve this:

  1. Upgrade to Fortify SCA 2.6.x (as of writing, latest version is 2.6.5).
  2. Download the Fortify Maven Plugin version 2.6 from https://customerportal.fortify.com and install it into your Hudson server's Maven repository.
  3. Update your project's pom to carry out the Fortify scan. There is an example provided with the Maven plugin.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文