gerrit 同步gitlab

1.安装gerrit replication插件

unzip gerrit.war
cp WEB-INF/plugins/replication.jar ~/temp/
ssh -p 29418 admin@172.19.16.64 gerrit plugin install -n replication.jar - <~/temp/replication.jar

报错:
fatal: remote installation is disabled

解决方法:Open YOUR_GERRIT_DIR/etc/gerrit.config file and add the following entry:

[plugins]
    allowRemoteAdmin = true
执行完成后或可执行:ssh ha gerrit plugin install -n replication.jar - <~/temp/replication.jar
ssh ha gerrit plugin ls
ssh -p 29418 admin@172.19.16.64 gerrit plugin ls
Name                           Version    Status   File
-------------------------------------------------------------------------------
replication                    v2.8       ENABLED  replication.jar




2.配置ssh config

cd ~/.ssh/
vim config
Host 10.27.97.39
        User admin
        IdentityFile ~/.ssh/admin
        StrictHostKeyChecking no
        UserKnownHostsFile /dev/null


3.替换gitlab lubase(project owner) ssh key
cd ~/.ssh/
rm id_rsa
rm id_rsa.pub
vim id_rsa
(粘贴owner的id_rsa)
vim id_rsa.pub
(粘贴owner的id_rsa.pub)
chmod 600 id_rsa
chmod 644 id_rsa.pub

4.加入gitlab pubkey到kown_hosts
sh -c "ssh-keyscan -t rsa gitlab.***.cn >> ~/.ssh/known_hosts"
sh -c "ssh-keygen -H -f ~/.ssh/known_hosts"


5.配置replication.config

[remote "gitlab.***.cn"]
        url = git@gitlab.***.cn:mobile/${name}.git
        push = +refs/heads/*:refs/heads/*
        push = +refs/tags/*:refs/tags/*
        push = +refs/changes/*:refs/changes/*
        timtout = 30
        threads = 3

6.启动replication

~/gerrit_code/bin/gerrit.sh restart
ssh ha gerrit plugin reload replication
ssh ha replication start ***

转载于:https://www.cnblogs.com/liuqiuqiu/p/7676342.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值