gpt4 book ai didi

git - ghprb - 添加内容以构建状态消息?

转载 作者:行者123 更新时间:2023-12-01 02:41:07 25 4
gpt4 key购买 nike

我们正在使用 ghprb在我们所有的 repo 协议(protocol)中,它很棒。不过,我希望能够将内容添加到 git 中显示的构建后信息中。我们使用 clover、findbugs 等,但大多数人都缺少这些的输出。

ghprb 可以很好地返回消息,例如

All is well — Build finished. n tests run, m skipped, k failed.

那里甚至还有一个指向 jenkins 工作的链接。

在 README 中,它暗示可以进行自定义。

You can extend the standard build comment message on github creating a comment file from shell console or any other jenkins plugin. Contents of that file will be added to the comment on GitHub. This is useful for posting some build dependent urls for users without access to the jenkins UI console.

但之后就没有更多细节了。有没有人设法添加/修改默认内容?

最佳答案

是的,您可以将任何自定义消息指定为默认内容。

有一个选项可以提及一个文件,其内容将被粘贴为作业的 pull 请求中的评论。

  <commentFilePath>/home/jenkins/<Some Directory Name>/commit.log</commentFilePath>

您可以提及 commit.log(或您命名的任何文件)中的任何内容。

要记住的 Gist ->这个文件必须在 jenkins master 上,在 slave 上有文件会对你有所帮助。因此,作为前/后构建步骤,您需要创建此文件并填充内容,

例如

如果你想显示 cobertura 图来 pull 请求提交,你可以添加这个。

echo "CodeCoverage Trend" > commit.log
echo "<img src="https://<Your servername>.com/job/${JOB_NAME}/cobertura/graph">" >> commit.log

关于git - ghprb - 添加内容以构建状态消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33829536/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com