/ 中存储网

Gerrit在Ubuntu 11.04上的安装与配置的方法及命令

2015-12-08 15:59:41 来源:中存储网

1,安装

下载地址:http://code.google.com/p/gerrit/downloads/list

或者用git取最新的code。

2、配置

一旦你是用git或者源码的话,可以参考 源码的 Documentation/install.txt

先配置好 数据库,我选的是mysql

CREATE USER 'xwang4'@'localhost' IDENTIFIED BY 'yoyo';

CREATE DATABASE reviewdb;

ALTER DATABASE reviewdb charset=latin1;

GRANT ALL ON reviewdb.* TO 'xwang4'@'localhost';

FLUSH PRIVILEGES;

然后初始化:

# java -jar gerrit-2.2.1.war init -d /home/xwang4/kunlun/gerrit/sites

xwang4@PEK-xwang4-Ubuntu:~/kunlun/gerrit$ java -jar gerrit-2.2.1.war init -d /home/xwang4/kunlun/gerrit/sites 
 
*** Gerrit Code Review 2.2.1 
***

*** Git Repositories 
***  
 
Location of Git repositories   [/home/xwang4/workspace/gingerbread-kunlun/devel]:  
 
*** SQL Database 
***  
 
Database server type   [MYSQL/?]:  
Server hostname[localhost]:  
Server port[(MYSQL default)]:  
Database name  [reviewdb]:  
Database username  [xwang4]:  
Change xwang4's password   [y/N]?  
 
*** User Authentication 
***  
 
Authentication method  [DEVELOPMENT_BECOME_ANY_ACCOUNT/?]: ? 
Supported options are: 
openid 
http 
http_ldap 
client_ssl_cert_ldap 
ldap 
ldap_bind 
development_become_any_account 
Authentication method  [DEVELOPMENT_BECOME_ANY_ACCOUNT/?]: openid 
 
*** Email Delivery 
***  
 
SMTP server hostname   [hhhhhhhhhhhhhhhhhhhhhhhhhhhh]:  
SMTP server port   [25]:  
SMTP encryption[TLS/?]:  
SMTP username  [xwang4]:  
Change xwang4's password   [y/N]?  
 
*** Container Process 
***  
 
Run as [xwang4]:  
Java runtime   [/usr/lib/jvm/java-6-sun-1.6.0.26/jre]:  
Upgrade /home/xwang4/kunlun/gerrit/sites/bin/gerrit.war [Y/n]?  
Copying gerrit.war to /home/xwang4/kunlun/gerrit/sites/bin/gerrit.war 
 
*** SSH Daemon 
***  
 
Listen on address  [*]:  
Listen on port [29418]:  
 
*** HTTP Daemon 
***  
 
Behind reverse proxy   [y/N]?  
Use SSL (https://) [y/N]?  
Listen on address  [*]:  
Listen on port [8088]:  
Canonical URL  [http://PEK-xwang4-ubuntu:8088/]:
 

然后启动:bin/gerrit.sh restart

一旦使用openid的话,注册的时候,会提示:Provider is not supported, or was incorrectly entered.

sudo ln -sf /etc/java-6-sun/security/cacerts /usr/lib/jvm/java-6-openjdk/jre/lib/security/cacerts