1

Rather than having teamcity log onto the gitolite server several tens of thousands of times each day - and also sitting around waiting for the poll to happen (or starting it manually).

It would be nice if it was possible to set it up gitolite hooks that inform TeamCity that the repository has changed.

Is such a configuration possible with TeamCity and gitolite?

I know Jenkins has a github plugin that works nicely - I use that setup for some Minecraft CI I am running privately.

Morten Nilsen
  • 621
  • 7
  • 18

1 Answers1

1

One way would be to gitolite (through a VREF hook) to call TeamCity through its REST API, in order to launch a build through web request.

You just need to make web request to the following URL:

http://YOURSERVER/httpAuth/action.html?add2Queue=btId

, where btId is build type Id – unique identifier for each build configuration.
To get it, you can just look for it in browser address bar, when clicking on build configuration, or use TeamCity REST API for details.


The OP Morten Nilsen didn't need a VREF:

  • add a file "post-receive" to .gitolite/hooks/common and
  • run gitolite setup --hooks-only
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks, that helped a lot! I ended up not using VREF hooks, I just added a post-receive server side hook instead. As a bonus, I got updated to gitolite3, even though I didn't need to in the end. – Morten Nilsen Apr 10 '13 at 09:44
  • People from the future: add a file "post-receive" to .gitolite/hooks/common and run gitolite setup --hooks-only – Morten Nilsen Apr 10 '13 at 09:46
  • 1
    @MortenNilsen Excellent. I have included your approach in the answer for more visibility. – VonC Apr 10 '13 at 10:16