简体   繁体   English

Jenkins 自动提交工件

[英]Jenkins automatically commit artifacts

Hey so I have a Jenkins Server which runs some tests on each commit made in gerrit.嘿,所以我有一个 Jenkins 服务器,它对在 gerrit 中所做的每个提交运行一些测试。 I now want to commit the results of the tests made by jenkins to the repo.我现在想将 jenkins 所做的测试结果提交到 repo。

Any idea how i might be able to do this?知道我怎么能做到这一点吗?

After the you run the tests, execute:运行测试后,执行:

git add TEST-RESULTS-FILES
git commit --amend -C HEAD

And then:进而:

git push origin HEAD:refs/for/BRANCH

These commands will add the tests results (git add), create a new patchset (git commit --amend) using the same commit message (-C HEAD) and push it to Gerrit (without submit).这些命令将添加测试结果 (git add),使用相同的提交消息 (-C HEAD) 创建一个新的补丁集 (git commit --amend) 并将其推送到 Gerrit(不提交)。

You need to configure Jenkins to NOT use this patchset in a new build or you'll be stuck in a build/add/commit/push/build/add/... cycle forever.您需要将 Jenkins 配置为不在新构建中使用此补丁集,否则您将永远陷入构建/添加/提交/推送/构建/添加/...循环。

Use Archive the Artifacts plugin in post-build action.在构建后操作中使用Archive the Artifacts插件。

在此处输入图片说明

You will also be able to download those artifacts easily from the build page.您还可以从构建页面轻松下载这些工件。

(OR) (或者)

If you want to publish test result, you can use other plugin like Publish HTML reports , Publish JUnit test result report etc.如果要发布测试结果,可以使用其他插件,如Publish HTML reportsPublish JUnit test result report等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM