How does the Gerrit- trigger plugin in Jenkins works?

moe312 picture moe312 · Apr 19, 2013 · Viewed 18k times · Source

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,

Answer

uncletall picture uncletall · Apr 25, 2013

The gerrit trigger works like this:

  1. It connects to the gerrit server using ssh and uses the gerrit stream-events command

  2. It then watches this stream as the data comes in

  3. It will try to match the events to triggers that have defined in your projects

Potential pit-falls:

  1. Jenkins user has improper ssh credentials

  2. Jenkins user does not have the stream-events rights

How to check:

  1. Login as jenkins user

  2. ssh -p 29418 [email protected] gerrit stream-events

  3. Push a commit to the server and you should see things on your stream

Problems:

  1. ssh connection failed? setup you ssh key pair

  2. No streaming right? Go to the All-Projects->Access and under Global Capabilities add Stream Events to the Non-Interactive Users group