...
BuildBot works in 2 parts, the slave(s) that build, and the master that control the slave(s).
In the following, I'm describing a setup with just one master and one slave, both on the same machine.
Disclaimer: everything here is done in a pretty dummy way, there's a lot of room for improvement.
...
Below is the content of my /etc/default/buildbot
Code Block | ||
---|---|---|
| ||
# buildbots to manage # add a new set of variables for each buildbot to start BB_NUMBER[0]=0 # index for the other values; negative disables the bot BB_NAME[0]="master" # short name printed on startup / stop BB_USER[0]="buildbot" # user to run as BB_BASEDIR[0]="/var/lib/buildbot/master" # basedir argument to buildbot (absolute path) BB_OPTIONS[0]="" # buildbot options BB_PREFIXCMD[0]="" # prefix command, i.e. nice, linux32, dchroot BB_NUMBER[1]=1 # index for the other values; negative disables the bot BB_NAME[1]="slave" # short name printed on startup / stop BB_USER[1]="buildbot" # user to run as BB_BASEDIR[1]="/var/lib/buildbot/slave" # basedir argument to buildbot (absolute path) BB_OPTIONS[1]="" # buildbot options BB_PREFIXCMD[1]="" # prefix command, i.e. nice, linux32, dchroot |
Creating the build scripts
In /home/buildbot/build, I created the scripts corresponding to the steps added to the factory:
Code Block | ||||
---|---|---|---|---|
| ||||
#!/bin/bash
umask 0022
rm -rf build
mkdir build |
That removes the whole build tree and create an empty folder for the new build.
If the previous build finished, or at least lasted for a while, this step could take more than 60 minutes...
One way to speed this up which is left out here for clarity is to put the build on a filesystem on a block device which is unmounted, reformatted and mounted for each build.
Code Block | ||||
---|---|---|---|---|
| ||||
#!/bin/bash
for i in git/*.git; do
echo "Fetching `basename $i`..."
cd $i
git fetch --all
cd - > /dev/null
done |