Monday, September 19, 2011

Deploying Buildbot on Windows Server 2003

Recently we started to use Buildbot to improve our development process. Installation didn't take too much time (even on Windows), but then I was a bit confused how to run buidbot master as a Windows service. Buildbot itself contains buildbot_service.py, but I found it much easier to use srvany.exe from Windows Server 2003 Resource Kit Tools.

So, if you don't have Windows Server 2003 Resource Kit Tools installed, download and install them (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17657).

Then I've created start.bat file in the directory where my buildbot project is located and put the following line there:

"c:\Program Files (x86)\Python27\Scripts\buildbot.bat" start master

master here is the name of sub-directory inside buildbot project directory where buildbot master files are.

You could try to run you start.bat to make sure buildbot is working fine.

Then using instsrv.exe from the same Windows Server 2003 Resource Kit Tools package I've created new service:

"c:\Program Files (x86)\Windows Resource Kits\Tools\instsrv.exe" Buildbot "c:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe"

Last thing a had to do was to specify application which srvany.exe has to run. This can be done using regedit:

  1. Open HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Buildbot

  2. Add new key "Parameters"

  3. Inside the "Parameters" add new string value "Application"

  4. Put "c:\path\to\your\buildbot\project\start.bat" as a value

  5. Again inside the "Parameters" add new string value "AppParameters"

  6. Put "/D c:\path\to\your\buildbot\project" as a value. This is important because we have to run start.bat being in the project directory.



Now we can start Buildbot service :)