gerrit init及邮箱配置

参考:

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

http://fatalove.iteye.com/blog/1332881


1. root@pc11307-HP:~/gerrit_sites/bin# ./gerrit.sh start
./gerrit.sh: 22: GERRIT_SITE: not found
解决方法:

cd /etc/default/

echo "GERRIT_SITE=/home/zww/gerrit_sites" > gerritcodereview

chmod 777 gerritcodereview

chown zww:zww gerritcodereview

重新启动apache2

./gerrit.sh start


2. java -jar ./soft/gerrit-2.4.2.war init -d /home/zww/gerrit_sites


*** Gerrit Code Review 2.4.2
***


*** Git Repositories
***

Location of Git repositories   [git]:

*** SQL Database
***

Database server type           [H2/?]:

*** User Authentication
***

Authentication method          [HTTP/?]:
Get username from custom HTTP header [Y/n]? N
SSO logout URL                 :

*** Email Delivery
***

SMTP server hostname           [smtp.hoperun.com]:
SMTP server port               [25]:
SMTP encryption                [NONE/?]:
SMTP username                  [zww]:
Change zww's password   [y/N]?

*** Container Process
***

Run as                         [root]:
Java runtime                   [/home/zww/jdk1.6.0_27/jre]:
Upgrade /home/zwwi/gerrit_sites/bin/gerrit.war [Y/n]?
Copying gerrit.war to /home/zww/gerrit_sites/bin/gerrit.war


*** SSH Daemon
***

Listen on address              [*]:

Listen on port                 [29418]:

*** HTTP Daemon
***

Behind reverse proxy           [y/N]?
Proxy uses SSL (https://)      [y/N]?
Subdirectory on proxy server   [/]:
Listen on address              [127.0.0.1]:
Listen on port                 [8088]:

Initialized /home/zww/gerrit_sites
注意:(1)配置的【】里面的Y/n,默认配置是大写的字母!!!

(2)web页面退出时报错,这是由于http认证引起的。

(3)时报错

Applation Error

Server Error

SMTP server rejected auth: 535 5.7.0 Error: authentication failed: authentication failure

解决方法:[sendemail]
                    enable = true
                    smtpServer = smtp.hoperun.com
                    smtpServerPort = 25
                    smtpUser = zww@hoperun.com
                    smtpPass =xxx
                    sslVerify = false

gerrit init 时会将smtpPass 保存在etc/secure.config中,如果修改密码,要修改该文件中的配置。

最后 gerrit.conf banben:

[gerrit]
    basePath = git
[database]
    type = H2
    database = db/ReviewDB
[auth]
    type = HTTP
[sendemail]
        enable = true
    smtpServer = smtp.hoperun.com
    smtpServerPort = 25
    smtpUser = zww@hoperun.com
        smtpPass = XXX
        sslVerify = false
        from = Code Review <zww@hoperun.com>
[container]
    user = zww
    javaHome = /home/zww/jdk1.6.0_27/jre
[sshd]
    listenAddress = *:29418
[httpd]
    listenUrl = http://*:8088/
[cache]
    directory = cache

3.登录后,在setting/Contact Information中配置fullname 和Register New Email。

Register New Emai时要注意,填完邮箱后点Register,所设置的邮箱就会收到Email Verification。里面会有链接,类似

$email.gerritUrl#/VE/qYFPf7nEH2whjyv27BQbhPrCKzQHc0zUw1/eeA==$MTAwMDAwMjp6b3Vfd2Vpd2VpQGhvcGVydW4uY29t,打开该链接(若不能打开的,新开一个浏览器,将url拷贝到浏览器的url栏中,并将$email.gerritUrl改为gerritUrl/(gerrit的访问地址,‘/’不能漏掉)),就会看到邮箱出现在web左上方用户名后面。貌似只有显示出来才可以接受的邮件。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值