Integrating GitLab with TeamCity

自作多情 提交于 2019-12-02 23:57:46

I'm running GitLab 8.0.2 and TeamCity 9.1.1 and am able to run CI builds on branches and merge requests.

I trigger CI builds for specific branches by setting a VCS trigger together with the branch specification +:refs/heads/(xyz*) where xyz is the string for our ticket system prefix since all active branches need to be named after an entry in our issue tracker.

I trigger builds for merge requests via the branch specification +:refs/(merge-requests/*)

Everything works as as expected and lets us know the status of all feature / bug branches and merge requests automatically.

Thanks to Rob's comment linking to the GitLab 8 release notes entry on the merge request spec.

Same problem here. There might be another way, I'm evaluating right now. Since there's no direct way of getting the merged state from the target MR, you have to build it on your own:

IMO there's the following todos
1.) init a bare repo $ git init
2.) add your target repo $ git remote add origin git@your-repo:<origin.group>/<origin.repo>.git
3.) add the remote/feature/to-merge's $ git remote add target git@your-repo:<feature.group>/<feature.repo>.git
4.) checkout your feature branch $ git checkout -b <feature.branch> feature/<feature.branch>
5.) checkout your original branch $ git checkout -b <origin.branch> origin/<origin.branch>
6.) Rebase feature into your original branch $ git rebase <feature.branch>

As stated here [1], GitLab-CE can fire an event on creation of a merge-request,

so all you have to do is building some meta, that can evaluate the WebHooks.

[1] http://doc.gitlab.com/ce/web_hooks/web_hooks.html#merge-request-events

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!