user3254126
user3254126

Reputation: 501

Jenkins automatically commit artifacts

Hey so I have a Jenkins Server which runs some tests on each commit made in gerrit. I now want to commit the results of the tests made by jenkins to the repo.

Any idea how i might be able to do this?

Upvotes: 1

Views: 2349

Answers (2)

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).

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.

Upvotes: 1

RejeeshChandran
RejeeshChandran

Reputation: 4358

Use Archive the Artifacts plugin in post-build action.

enter image description here

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.

Upvotes: 0

Related Questions