4

I've managed to configure TeamCity to automatically pull the new checked-in changes from GitLab and build it.

Next step I would like that the build status icon in GitLab reflects the build status from TeamCity.

At the moment each build TeamCity builds, GitLab continues to show "build:skipped". As I understand this is because it's not run with Gitlab CI and that my repo misses gitlab-ci.yml. I did setup the TeamCity CI service for the project but it didn't help with anything. Maybe I'm misunderstanding the purpose of this service.

Is there a way to change the default build tracker from GitLab-CI to TeamCity so that I can see the build status from TeamCity in GitLab as well?

Claudiu
  • 275
  • 1
  • 3
  • 9

2 Answers2

9

With TeamCity 10 the Commit Status Publisher build feature is deployed with the default installation. Also GitLab is supported now out of the box. Enter the URL of your server and your private token and it will work like a charm.

dwonisch
  • 5,595
  • 2
  • 30
  • 43
  • 2
    what URL do you use? I'm getting 404 with the example they show. – bj0 Aug 02 '16 at 00:20
  • What's the url when using the hosted Gitlab version? – stevenw00 Sep 02 '16 at 06:13
  • Where and how I have to configure this? – dikkini Jul 31 '17 at 15:17
  • 1
    In teamcity under "Build Features" tab you should choose "add build feature"->"commit status published". Url for gitlab will be like https://gitlabserver/api/v3, private token can be found on https://gitlabserver/profile/account Use "test connection" to check – Danila Polevshchikov Nov 30 '17 at 13:46
  • Note that as of GitLab 10.2 private tokens are no longer supported: https://gitlab.com/gitlab-org/gitlab-ce/issues/38595. Simply create a personal access token instead, and make sure that the account has at least Developer access. – James Skemp Jan 23 '18 at 14:24
  • Just FYI Gitlab integration doesn't work with Fork-MR-Origin style of work, see: https://github.com/JetBrains/commit-status-publisher/pull/39 Also it doesn't work at all after configuring. The pipeline status is stucked at 'Created' on Gitlab side. – versedi Oct 09 '19 at 13:52
2

To view your build status on GitLab, you need to setup a commit status publisher feature for your build configuration. The commit status publisher plugin is open source and located on GitHub

Currently, it does not have GitLab support out-of-the-box, but we have received a pull request that implements it. We have not yet merged it to the plugin, so you can either wait for the pr to be merged (watch the request in the tracker here), or you can build the plugin from the branch with the pr included and install it on your server.

James Skemp
  • 8,018
  • 9
  • 64
  • 107
Oleg Rybak
  • 1,651
  • 1
  • 14
  • 27