码迷,mamicode.com
首页 > 其他好文 > 详细

gerrit 同步gitlab

时间:2017-10-16 13:45:52      阅读:382      评论:0      收藏:0      [点我收藏+]

标签:chmod   pen   file   解决   and   pubkey   start   scan   err   

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 -p 29418 admin@172.19.16.64 gerrit plugin reload replication
ssh -p 29418 admin@172.19.16.64 replication start ***

gerrit 同步gitlab

标签:chmod   pen   file   解决   and   pubkey   start   scan   err   

原文地址:http://www.cnblogs.com/liuqiuqiu/p/7676342.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!