Buildbot Install

#buildbot

For my static site build and deployments, I’ve been using Jenkins on a scheduled EC2 instance. Since the content on the sites is updated, at most, once or twice a day, the Jenkins instance only ran once a day. This worked well, but now that I’m mirroring all of my repositories locally, I want to switch the builds locally too.

Buildbot is what I’ll be using instead of Jenkins.

Setup

$ sudo pip install buildbot
$ sudo pip install buildbot-slave
$ sudo useradd -d /data/buildmaster -g buildbot buildmaster
$ sudo useradd -d /data/buildslave -g buildbot buildslave

Buildbot can be installed either from the distro’s package manager, source, or using pip. The two new users are the ones that the buildmaster and slave will be running as.

Create the Buildmaster

I ran into an issue when trying to create this on a CIFS share and it turns out it was due to the create-master` script trying to do a CHMOD on a file. I addednoperm`` to /etc/fstab and remounted the share to ignore this action.

$ buildbot --verbose create-master --relocatable --db=postgresql+psycopg2://USER:[email protected]:5432/DATABASE BASEDIR

I used Postgresql for this instead of the default SQLite. [1] [2]

Create Buildbot Slaves

Each build slave will need its own username/password combination. This can be set under the buildmasters master.cfg file with the following line:

c['slaves'] = [buildslave.BuildSlave("NAME", "PASSWORD")]

Next, create the buildslave.

buildslave create-slave BASEDIR MASTERHOST:PORT SLAVENAME PASSWORD

Starting the Services

Run the services on their respective system accounts.

buildmaster

buildbot start BASEDIR

buildslave

buildslave start BASEDIR

Conclusion

This will install a master/slave and get them connected to each other. The next section in the documentation, Concepts, shows what to do next.

[1] https://docs.buildbot.net/current/manual/installation.html

[2] https://docs.buildbot.net/current/manual/cfg-global.html#database-specification