Giter Site home page Giter Site logo

gerrit-verify-status-reporter-plugin's Introduction

Overview

The Jenkins Gerrit Verify Status Reporter plugin allows Jenkins to publish test reports to Gerrit instances that are using the Gerrit verify-status plugin.

Reqiurements

Quick Start Guide

This is a quick start guide on how to quickly install and configure Gerrit and Jenkins so that Jenkins can report job results to Gerrit.

NOTE: This Guide is meant for the impatient hacker who doesn't want to read an endless streams of documentation and the developers who do don't want to write it :)

Gerrit Verify Status Plugin

Setup database

  • Setup database connection info in gerrit.config
[plugin "verify-status"]
  dbType = h2
  database = /home/joe/gerrit_testsite/db/CiDB

NOTE: If you prefer to run without prompts add the --batch flag.

Setup the Gerrit user

  • Start Gerrit
  • Create a Gerrit user (i.e. 'Jenkins') to allow the jenkins to connect to it.
  • Add the 'Jenkins' user to the 'Non-Interactive Users' group.
Gerrit -> People -> List Groups -> Non-Interactive Users
Add 'Jenkins' user to the group
Projects -> List -> All-Projects -> Access
Edit
Global Capabilities -> Add Permission ->  Save Verification Report -> Add Group
Allow: Non-Interactive Users
Global Capabilities -> Add Permission ->  Stream Events -> Add Group
Allow: Non-Interactive Users
Save settings
  • Create an http password for the 'Jenkins' user.
Login as the Jenkins user
Settings -> HTTP Password -> Generate Password

Gerrit Verify Status Reporter Plugin

Install

  • Install the Jenkins Gerrit trigger plugin using the Jenkins plugin manager.
  • Install the Jenkins gerrit-verify-status-reporter plugin
  • Configure the Gerrit trigger global config to connect to a Gerrit instance.
Jenkins -> Manage Jenkins -> Gerrit Trigger
  • Configure it to use the Gerrit Rest API. The config is under the 'Advanced' setting. Enter the http password from Setup the Gerrit User section.
  • Configure Jenkins Global configuration to enable environment variables.
Jenkins -> Manage Jenkins -> Configure System -> Global properties
Enable Environment variables
Save settings

Setup Job

Note: The job abstain and value data are automatically determined:

  • abstain is true if the Gerrit Trigger is set to SilentMode or any SkipVote parameter is enable.
  • value is set to +1 for pass, -1 for fail and 0 for unstable result.

Testing

  • Login into Gerrit with any user.
  • View any patchset.
  • Reply to a patchset with a 'recheck' comment (this should auotmatically kick off a jenkins build).
  • After Jenkins has completed running the build it will send a verification report to Gerrit.
  • The report should now appear on the Gerrit UI (under the Code-Review label).

Debugging

  • Check the Gerrit logs and Jenkins logs to see if there are any errors
  • Communication between Gerrit and Jenkins are done using SSH and REST APIs so make sure the security is setup so that one server can communicate with the other.
  • Use the ssh gsql command to see if any test results are in the database.

gerrit-verify-status-reporter-plugin's People

Contributors

zaro0508 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.