# # # add_file "bb-howto.txt" # content [f7c1513557fee0b23d3edff747caa6091b07cad0] # ============================================================ --- bb-howto.txt f7c1513557fee0b23d3edff747caa6091b07cad0 +++ bb-howto.txt f7c1513557fee0b23d3edff747caa6091b07cad0 @@ -0,0 +1,79 @@ +Setting up a monotone buildbot +============================== + +1) Create a new user to run the builds (very important): + +On debian this is: + +# adduser --disabled-login --disabled-password mtbuildbot + +On gentoo it is: + +# adduser -s /bin/false -d /home/mtbuildbot -m mtbuildbot + +Other systems, I don't know, probably something like the above. + +2) Install the necessary files into the new user's home directory: + +# cd ~mtbuildbot +# wget http://venge.net/monotone/monotone-buildbot-2.tar.bz2 +# tar xvjf monotone-buildbot-2.tar.bz2 + +3) Install Twisted. You can use a package, or just drop it into the + home directory directly: + +# wget http://twisted.sourceforge.net/Twisted_NoDocs-1.3.0.tar.bz2 +# tar xvjf Twisted_NoDocs-1.3.0.tar.bz2 + +3) Install a monotone binary into the new user's home directory; this + is better than using the system-installed one, because it means + that you don't have to worry about accidentally breaking the + buildbot when upgrading. (On the other hand, it also means that + whenever the netsync server protocol changes, you'll have to + upgrade the copy of monotone installed here.) + +# cp /path/to/working/monotone monotone + +You should let me know where the binary you want to use is located, +since the path to the binary has to be set on the server side. + +4) Create a buildbot instance: + +$ PATH=$HOME/Twisted-1.3.0/bin:$PATH +PYTHONPATH=$HOME/monotone-buildbot:$HOME/Twisted-1.3.0 +monotone-buildbot/bin/buildbot slave slave-dir venge.net:9001 + + +(replacing and by the name of this slave and the +password that it was assigned). Note that you MUST run this command +as the buildbot user you have created. + +5) Install runit, http://smarden.org/runit or apt-get install runit or + whatever. + +6) Create a file called ~mtbuildbot/run: + +#!/bin/sh +export PATH=$HOME/Twisted-1.3.0/bin:$PATH +export PYTHONPATH=$HOME/monotone-buildbot:$HOME/Twisted-1.3.0 +cd $HOME/slave-dir +exec nice twistd --nodaemon --no_save -y buildbot.tac -l twistd.log + +and make it executable. (If you're on win32, you may need to add a +--reactor=win32 argument to that command line. But then, you're +probably not using runit in that case anyway, I guess...) + +7) Make sure that permissions are correct. The mtbuildbot user needs + write access to slave-dir, and should not have write access to + anything else. + +8) Set up the slave to be automatically started at boot: + +# echo '@reboot runsv .' | su mtbuildbot -c 'crontab -e -' + +9) Start the slave now: + +# su mtbuildbot -c 'runsv .' & + +10) Check slave-dir/twistd.log to see it starting up and check for + errors.