14

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,

moe312
  • 173
  • 1
  • 3
  • 6
  • Can you give us some more to go on here? Documentation on the Gerrit trigger is at [Gerrit Trigger](https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger), but I'm assuming you have some more specific questions. What have you tried and what are you attempting to do? – gaige Apr 20 '13 at 11:46
  • Yes - you go it right. what I want to know excatly is how the information (code) from Gerrit is transferred to Jenkins and vice versa ? What is the form of Information? I know that the information is ent via SSH - but how ? Thank you – moe312 Apr 24 '13 at 14:38
  • Also, which API does the plugin connects too ? – moe312 Apr 24 '13 at 21:05
  • The only real documentation is the source, and I'm not that deeply familiar with it, but the base readme at github does have some minor info: https://github.com/jenkinsci/gerrit-trigger-plugin . – gaige Apr 24 '13 at 21:44
  • Alright, thanks Gaige! Appreciate your answer. – moe312 Apr 30 '13 at 14:36

1 Answers1

42

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 jenkins@your.domain.com 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

uncletall
  • 6,609
  • 1
  • 27
  • 52