0

we have a subgit bridge between our SVN and Gitlab instances. When we commit something to SVN, the commit is beeing synced to Gitlab. This works fine, only problem is that the CI does not start.

  • Commit to Gitlab directly -> Build starts
  • Commit to SVN -> Syncing to Gitlab -> Build does not start

Is this a known limitation? Can it be fixed? Are there any workarounds?

  • Gitlab v8.10
  • Subgit v3.1.1
medokin
  • 610
  • 9
  • 21
  • How do you trigger CI? When you push to GitLab directly, pre-receive and some other hooks are called, when SubGit fetches changes from SVN and when svn.triggerSvnPostReceive=true, post-receive hook is triggered, maybe you could trigger CI from 'user-post-receive' hook (see [SubGit book](http://www.subgit.com/remote-book.html#22)). – Dmitry Pavlenko Aug 22 '16 at 11:09
  • @DmitryPavlenko Subgit hooks are lying in `custom_hooks` and gitlabs in `hooks`. So if I add a new `user-post-receive` in `custom_hooks` that calls `hooks/post-receive` it should work? – medokin Aug 22 '16 at 11:46
  • I depends on how you trigger CI normally (what CI are you speaking about? Bamboo, TeamCity?). I think it's worth trying, but GitLab is a bit complicated, so if you create `user-post-receive` in `custom_hooks`, it will be triggered, but I'm not sure that calling `hooks/post-receive` will do what you want as I don't know how you trigger CI builds normally. And also normally `hooks/post-receive` would trigger `custom_hooks/post-receive` that will again trigger `user-post-receive` and so on. If your CI has REST API, it's better to trigger it from `user-post-receive` directly. – Dmitry Pavlenko Aug 22 '16 at 14:32
  • Related [issue](https://issues.tmatesoft.com/issue/SGT-1116) in SubGit tracker. – Dmitry Pavlenko Aug 22 '16 at 14:37
  • Im using Gitlab CI, it gets triggered by `hooks/post-receive`. So a gitlab push triggers subgit hooks, but not other way around? – medokin Aug 23 '16 at 10:25
  • As I wrote, actually the latest version of SubGit runs `hooks/post-receive` when svn.triggerSvnPostReceive=true in subgit/config (check you config for that option). It passes GL_ID="user-1", GIT_DIR=".", SVN_LAST_FETCHED_REVISION=, as the environment. You can run the hook manually with this environment to see if this is enough to trigger CI build. If it doesn't help, you can use GitLab CI [API](http://docs.gitlab.com/ce/ci/triggers/README.html) directly. If you have further questions, let's move the discussion to the [issue tracker](https://issues.tmatesoft.com/issue/SGT-1116). – Dmitry Pavlenko Aug 23 '16 at 12:53

0 Answers0