I am trying to understand how does the gerrit-trigger in Jenkins works in details? Also, how is the test for the triggered cose is being invoked ?
Thanks,
To achieve this, a Jenkins job is configured to clone the changes from Gerrit, analyze the project with CodeChecker and publish (as comments in Gerrit) the issues found in the changed files. Based on the result of the analysis, the job also sets the Code-Review and Verify labels in Gerrit Review.
This plugin integrates Jenkins to Gerrit code review for triggering builds when a "patch set" is created.
As a Code Stream administrator or developer, you can integrate Code Stream with the Gerrit code review life cycle by using the Gerrit trigger. The event triggers a pipeline to run when you create a patch set, publish drafts, merge code changes on the Gerrit project, or directly push changes on the Git branch.
The gerrit trigger works like this:
It connects to the gerrit server using ssh and uses the gerrit stream-events command
It then watches this stream as the data comes in
It will try to match the events to triggers that have defined in your projects
Potential pit-falls:
Jenkins user has improper ssh credentials
Jenkins user does not have the stream-events rights
How to check:
Login as jenkins user
ssh -p 29418 [email protected] gerrit stream-events
Push a commit to the server and you should see things on your stream
Problems:
ssh connection failed? setup you ssh key pair
No streaming right? Go to the All-Projects->Access and under Global Capabilities add Stream Events to the Non-Interactive Users group
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With