需要 GitBlit groovy 挂钩,推送更改为其他 Gitblit 服务器回购

Need GitBlit groovy hook which push changed to other Gitblit server repo

Need a groovy push hook scripts from your Gitblit instance to another Gitblit instance

我有两个私有的 linux servers,比如说 AB,两者都安装了 GitBlit。所有开发人员都在服务器 A 上提交并推送他们的更改,我希望 BA 保持同步。

有一些Groovy hook但我是新手,谁能帮忙提供一下。

PS:如果在 A 上发现任何推送事件,一些脚本将被触发并且它 push 更改为 B

为什么不将 B 设置为 A 的 mirror

谢谢james-moger

基于下面是脚本截图。

File baseFolder = new File("/root/softwares/apache-tomcat-6.0.32/webapps/gitblit/WEB-INF/data/git");
File repoFolder = new File(baseFolder, repository.name);
Git git = Git.open(repoFolder, FS.detect())
git.push().setRemote("ssh://admin@111.11.111.111:29418/testrepo.git").setPushAll().call();