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
- Jenkins user has improper ssh credentials
- Jenkins user does not have the stream-events rights
- The user public key was not added to gerrit
- Login as jenkins user, assume username is admin
- ssh -p 29418 admin@gerrit_server gerrit stream-events
- Push a commit to the server and you should see things on your stream
- 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
Gerrit access rights
- Create the profile through in Gerrit web interface for your Jenkins user, and set up a SSH key for that user.
- Gerrit web interface > Admin > Groups > Non-Interactive Users > Add your jenkins user.
- Admin > Projects > ... > Access > Edit
- Reference:
refs/*
- Read: ALLOW for Non-Interactive Users
- Reference:
refs/heads/*
- Label Code-Review: -1, +1 for Non-Interactive Users
- Label Verified: -1, +1 for Non-Interactive Users
- Reference:
- Gerrit web interface > People > Create New Group : "Event Streaming Users". Add your jenkins user.
- Admin > Projects > All-Projects > Access > Edit
- Global Capabilities
- Stream Events: ALLOW for Event Streaming Users
- Global Capabilities
This is just copied from stackoverflow...
ReplyDelete