首页 > 代码库 > Gerrit安装及复制到Gitlab
Gerrit安装及复制到Gitlab
# 直接下载jar文件后 java -jar gerrit-2.14.1.war init -d /opt/gerrit # 安装复制插件 unzip gerrit-2.14.1.war ssh -p 29418 gerrit_admin_user@localhost gerrit plugin install -n replication.jar - < ./WEB-INF/plugins/replication.jar # 如果安装时提示权限问题,要在gerrit.config 上添加 allowRemoteAdmin 参数,文件见下面
# gerrit IP: 192.168.5.2 # gitlab IP: 192.168.5.3 # 在gerrit 上,把下面的结果放到gerrit账号的 known_hosts 文件中 ssh-keyscan -t rsa 192.168.5.3 >> ~/.ssh/known_hosts # 同时把gerrit用户的ssh-key 添加到gitlab仓库中,并设置为需要同步仓库的master
root@grt01:/opt/gerrit/etc# cat replication.config [remote "git01"] projects = grt_demo01 url = git@192.168.5.3:mobile/grt_demo01.git push = +refs/heads/*:refs/heads/* push = +refs/tags/*:refs/tags/* push = +refs/changes/*:refs/changes/* timtout = 30 threads = 3
root@grt01:/opt/gerrit/etc# cat gerrit.config [gerrit] basePath = git serverId = 822d309b-9f9b-478b-21c7-1ca14f92abcf canonicalWebUrl = http://grt01.test.local:8080/ [database] type = h2 database = /opt/gerrit/db/ReviewDB [index] type = LUCENE [auth] type = LDAP gitBasicAuthPolicy = HTTP [ldap] server = ldap://ad.test.local username = service@test.local password = 8888888 accountBase = DC=test,DC=local # groupBase = DC=test,DC=local accountPattern = (&(objectClass=person)(sAMAccountName=${username})) accountFullName = displayName accountEmailAddress = mail accountSshUserName = sAMAccountName # groupMemberPattern = (sAMAccountName=${username}) # groupName = cn [receive] enableSignedPush = false [sendemail] smtpServer = smtp.test.com smtpServerPort = 25 smtpUser = gerrit@test.com enable=true [container] user = gerrit javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre [sshd] listenAddress = *:29418 [httpd] listenUrl = http://*:8080/ [cache] directory = cache [plugins] # allow install plugin allowRemoteAdmin = true
上面使用的是域认证
参考
Gerrit安装及复制到Gitlab
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。