如何安装Gerrit

增加nginx配置
server {
    listen       80;
    server_name  XXXX.XXXXX.com;    // Gerrit主机所在的域名
    allow all;
    deny  all;

    auth_basic "Welcomme to Gerrit Code Review Site!";
    auth_basic_user_file /var/gerrit/gerrit.password;

    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
    root   html;
    }
}
添加用户信息
htpasswd -c /var/gerrit/gerrit.password admin
htpasswd /var/gerrit/gerrit.password jijun.xie

安装gerrit
java -jar gerrit-2.15.3.war init -d ~/gerrit
gerrit config配置
root@zabbixserver:~/gerrit/etc# cat gerrit.config

[gerrit]
        basePath = git
        serverId = 4e1db49b-5b0b-4332-8ff7-90e44a3bdc8c
        canonicalWebUrl = http://XXXX.XXXXX.com  // 代码review发送邮件中包含连接的前缀
[database]
        type = h2
        database = /root/gerrit/db/ReviewDB
[noteDb "changes"]
        disableReviewDb = true
        primaryStorage = note db
        read = true
        sequence = true
        write = true
[index]
        type = LUCENE
[auth]
        type = HTTP
[receive]
        enableSignedPush = false
[sendemail]
        enabled = true
        smtpServer = smtp.mxhichina.com
        smtpServerPort = 80
        smtpUser = XXXXXX@XXXXX.com
        smtpPass = XXXXXXXXXXX
        smtpEncryption = tls
        from = XXXXX@XXXXXXX.com

[container]
        user = root
        javaHome = /opt/jdk1.8.0_181/jre
[sshd]
        listenAddress = *:29418
[httpd]
        listenUrl = http://*:8080/
[cache]
        directory = cache
[label "Verified"]
        defaultValue = 1
replication 插件配置

需要按照要求安装插件,请至少安装如下插件:

  • replication
  • download-commands
  • hooks
root@zabbixserver:~/gerrit/etc# cat replication.config
[remote "gitee.com"]
        url = git@gitee.com:arthurlchen/${name}.git
        url = git@gitee.com:IntraMirror/${name}.git
        push = +refs/heads/*:refs/heads/*
        push = +refs/tags/*:refs/tags/*
        push = +refs/changes/*:refs/changes/*
        timtout = 30
        threads = 3
ssh config 配置
root@zabbixserver:~/.ssh# cat config
Host gitee.com
        User git
        IdentityFile ~/.ssh/id_rsa
        StrictHostKeyChecking no
        UserKnownHostsFile /dev/null

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值