Gerrit 使用简介

       Gerrit,一种免费、开放源代码的代码审查软件,使用网页界面。利用网页浏览器,同一个团队的软件程序员,可以相互审阅彼此修改后的程序代码,决定是否能够提交,退回或者继续修改。它使用Git作为底层版本控制系统。 (from 百度百科)

Gerrit 审核系统搭建过程

创建gerrit2用户

$sudo useradd -m -d /home/gerrit2 -s /bin/bash gerrit2

$sudo su gerrit2

安装mysql以及java环境

略。apt-get

配置mysql

#mysql -u root –p
Mysql>
  #CREATE USER 'gerrit2'@'localhost' IDENTIFIED BY 'secret';
  #CREATE DATABASE reviewdb;
  #ALTER DATABASE reviewdb charset=latin1;
  #GRANT ALL ON reviewdb.* TO 'gerrit2'@'localhost';
  #FLUSH PRIVILEGES;

下载gerrit并进行初始化

$wget http://gerrit-releases.storage.googleapis.com/gerrit-2.7.war
$java -jar gerrit-2.7.war init -d review_site

参见http://www.infoq.com/cn/articles/Gerrit-jenkins-hudson/
Create '/home/gerrit2/review_site' [Y/n]? Y
Location of Git repositories   [git]:
Database server
type           [h2]: mysql

Gerrit Code Review is not shipped with MySQL Connector/J 5.1.21
**  This library is required for your configuration. **
Download and install it now [Y/n]? Y
Downloading
http://repo2.maven.org/maven2/mysql/mysql-connector-java/5.1.21/mysql-connector-java-5.1.21.jar
Checksum mysql-connector-java-5.1.21.jar OK
Server hostname               
[localhost]:
Server
port                   
[(mysql default)]:
Database
name                 
[reviewdb]:
Database
username             
[gerrit2]:
gerrit2's
password            
:  secret
             
confirm password :
SMTP server hostname          
[localhost]:
SMTP server
port              
[(default)]:
SMTP
encryption               
[NONE/?]:
SMTP
username                 
:
更具体是进行初始化

运行gerrit审核系统

$ ./review_site/bin/gerrit.sh start

登录gerrit审核系统官网

默认端口号:8080

修改gerrit界面颜色

默认情况下是纯白色的,不美观可以对
review_site/etc/gerrit.config 修改,然后重启服务,下面是一个颜色配置模板:

[theme]

backgroundColor = FCFEEF

textColor = 000000

trimColor = D4E9A9

selectionColor = FFFFCC

topMenuColor = D4E9A9

changeTableOutdatedColor = F08080

[theme
"signed-in"]

backgroundColor = FCFEEF

textColor = 000000

trimColor = D4E9A9

selectionColor = FFFFCC

topMenuColor = D4E9A9

changeTableOutdatedColor = F08080

更多信息,索引 https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#_a_id_theme_a_section_theme

Gerrit 系统正常测试

  ssh -p 29418 username@webhost 测试gerrit是否正常运行,根据  http://www.infoq.com/cn/articles/Gerrit-jenkins-hudson/ 修改相关ssh配置,成功后会显示如下信息:
         

**** Welcome to Gerrit Code Review ****

 
  Hi demo, you have successfully connected over SSH.
 
  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:
 
  git clone ssh://demo@localhost:29418/REPOSITORY_NAME.git
 
Connection to localhost closed.

Gerrit创建第一个项目

创建项目, 克隆病推送代码!

ssh -p 29418 admin@localhost gerrit create-project --name example.git

注意: 在gerrit系统上第一个注册的人自动成为管理员,只有管理员才有创建project权限

Github+gerrit+Jenkins(hudson) +redmine

职责:

GitHub is a resource for managing Git code repositories and interacting with other developers. Jenkins is used to continuously test all of the components of OpenStack to ensure functionality and to verify that each change to the code base works as intended. Gerrit is a code review system originally developed for use by the Android Open Source Project and allows us to build a workflow where every change is peer-reviewed and tested by Jenkins before being merged into the main repository.

工作流:

  1. developer checks out source from github.
  2. developer makes changes.
  3. developer pushes to gerrit.
  4. gerrit sends change notice to jenkins for integration test.
  • jenkins pulls changes directly from gerrit git server.
  • on pass, jenkins adds +1 to gerrit review, passes review to other developers.
  • on failure, jenkins adds -1 to gerrit review
  • pass/fail status pushed to redmine
  1. other developers review change, approve (+2)
  2. gerrit commits changes to github repository.
  • github hook notifies redmine of updates.
  • redmine pulls changes from github, parses commit messages for ticket information.
  1. developer fetchs changes from github ... back to 2. [EDIT]: we switched to pulling directly from gerrit. Github remains as a mirror for pulling production sources.

安装运行Jenkins

根据https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger配置jenkins以及Gerrit

jenkins + github http://blog.csdn.net/john_cdy/article/details/7738393

java -jar jenkins.war --httpPort=$PORT --httpListenAddress=$HTTP_HOST

how to use jenkins: https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins

http://fourkitchens.com/blog/2011/09/20/trigger-jenkins-builds-pushing-github

OpenStack 审核流程图:

Background

Available Links:

Jenkins 学习:http://www.cnblogs.com/itech/archive/2011/11/23/2260009.html

Gerrit 学习:http://ci.openstack.org/gerrit.html (介绍了OpenStack源代码开发维护更新流程!)

Gerrit introduction: http://gerrit-documentation.googlecode.com/svn/Documentation/2.6/intro-quick.html

Gerrit installation: http://gerrit.googlecode.com/svn/documentation/2.1.6/install.html

Git、Gerrit与Jenkins/Hudson CI服务器:

http://www.infoq.com/cn/articles/Gerrit-jenkins-hudson/

GerritJenkinsGithub: https://wiki.openstack.org/wiki/GerritJenkinsGithub

Ideas and Actions: https://groups.google.com/forum/#!msg/repo-discuss/rersrCtdEiY/usAodLofFo8J

Gerrit 工作流: https://wiki.openstack.org/wiki/GerritWorkflow

git diff 的用法:  http://blog.sina.com.cn/s/blog_40e9d4dd0100xi8p.html

git rebase用法: http://www.cnblogs.com/kym/archive/2010/08/12/1797937.html

Gerrit 安装:http://ci.openstack.org/gerrit.html

图解GIT:  http://nettedfish.sinaapp.com/blog/2013/08/05/deep-into-git-with-diagrams/

Gerrit 系统初探 (已转移到 https://steemit.com/gerrit/@linvictor88/gerrit )的更多相关文章

  1. Gerrit系统框架介绍

    Gerrit目录介绍 转自:https://blog.csdn.net/tanshizhen119/article/details/79889242 先上图 bin/ : 主要是放gerrit.sh启 ...

  2. [已转移]js事件流之事件冒泡的应用----事件委托

    该文章已转移到博客:https://cynthia0329.github.io/ 什么是事件委托? 它还有一个名字叫事件代理. JavaScript高级程序设计上讲: 事件委托就是利用事件冒泡,只指定 ...

  3. [已转移]IE事件流和DOM标准事件流的区别

    该文章已转移到博客:https://cynthia0329.github.io/ 1.执行的顺序不一样 冒泡型事件模型: button->div->body (IE事件流) 捕获型事件模型 ...

  4. [已转移]JavaScript事件---DOM事件流

    该文章已转移到博客:https://cynthia0329.github.io/ 事件发生时会在元素节点与根节点之间按照特定的顺序传播,路径所经过的所有节点都会收到该事件 这个传播过程即DOM事件流. ...

  5. 博客不再更新,已转移到自己的小站iwenku.net

    博客不再更新,已转移到自己的小站iwenku.net,欢迎访问! 博客不再更新,已转移到自己的小站iwenku.net,欢迎访问! 博客不再更新,已转移到自己的小站iwenku.net,欢迎访问! 博 ...

  6. 博客已转移至 http://blog.yemou.net/

    博客已转移至 http://blog.yemou.net/ , 该网站是一家更加专业的网站,欢迎大家过去交流

  7. 【重要通知】本人所有技术文章转移至https://zzqcn.github.io

    本人所有技术文章转移至 https://zzqcn.github.io

  8. Linux系统初探过程总结

    Linux系统初探的过程大约用了一周的时间,这周基本将Linux系统安装,PostgreSQL安装,Nginx服务器安装,ASP.NET Core应用部署都走了一遍.由于以前没有怎么接触和使用过Lin ...

  9. 金蝶K3,名称或代码在系统中已被使用,由于数据移动,未能继续以NOLOCK方式扫描

    使用金蝶K3时出现:名称或代码在系统中已被使用:错误代码:3604(E14H)source:Microsoft OLE DB provider for SQL SERVERDetail:由于数据移动, ...

随机推荐

  1. 201621123006 《Java程序设计》第13周学习总结

    1. 本周学习总结 以你喜欢的方式(思维导图.OneNote或其他)归纳总结多网络相关内容. 2. 为你的系统增加网络功能(购物车.图书馆管理.斗地主等)-分组完成 为了让你的系统可以被多个用户通过网 ...

  2. react 拖拽排序---原生

    定义css, 两个动画 .drag-up { -webkit-animation: dragup ease 0.2s 1; animation: dragup ease 0.2s 1; -webkit ...

  3. test20181018 B君的第一题

    题意 分析 考场爆零做法 考虑dp,用\(f(i,j,0/1)\)表示i及其子树中形成j个边连通块的方案数,其中i是否向外连边. \(O(n^3)\),转移方程太复杂就打挂了. #include< ...

  4. 【转】ubuntu中没有/etc/inittab文件探究

    原文网址:http://blog.csdn.net/gavinr/article/details/6584582 linux 启动时第一个进程是/sbin/init,其主要功能就是软件执行环境,包括系 ...

  5. Hive之 数据存储

    首先,Hive 没有专门的数据存储格式,也没有为数据建立索引,用户可以非常自由的组织 Hive 中的表,只需要在创建表的时候告诉 Hive 数据中的列分隔符和行分隔符,Hive 就可以解析数据. 其次 ...

  6. php 文件上传$_FILES中error返回值详解

    用PHP上传文件时,我们会用程序去监听浏览器发送过来的文件信息,首先会通 过$_FILES[fieldName]['error']的不同数值来判断此欲上传的文件状态是否正常.$_FILES[field ...

  7. RK3288 GT触摸屏移植调试

    CPU:RK3288 系统:Android 5.1 IC:GT911 1.在 menuconfig 或者 rockchip_defconfig 中支持触摸屏.具体用哪种方式需要结合编译方法. 按照瑞芯 ...

  8. XSS漏洞攻击原理与解决办法

    转自:http://www.frostsky.com/2011/10/xss-hack/ 对于的用户输入中出现XSS漏洞的问题,主要是由于开发人员对XSS了解不足,安全的意识不够造成的.现在让我们来普 ...

  9. PowerDesigner如何将消失的工具栏显示出来

    工具Tool->自定义工具栏,在弹出窗口中选中Palette,并点击[Close]关闭窗口.  

  10. log4net 使用指南,最常遇到的问题整理。。。

    一.    Log4net特征    Log4net是一个用于.NET开发环境的日志记录组件,由于它的超快及超灵活,很多大型的应用都会用到.    它有如下特点:    1.自定义日志输出级别    ...