1. Home
  2. Linux
  3. Debian
  4. How to Install Buildbot on Debian 9

How to Install Buildbot on Debian 9

How to Install Buildbot on Debian 9
How to Install Buildbot on Debian 9

Learning new things a new day! Here is our new tutorial “How to Install Buildbot on Debian 9″.
before going into details
Check out Our Best VPS Hosting and WordPress hosting for scaling your cloud-based applications and processes.

What is Buidlbot

Buildbot is a continuous integration framework written in Python which automates the test, build, and release software cycles.

  • It is built using the Twisted networking engine, supports parallel execution of jobs across several platforms, and runs on all major operating systems.
  • The Buildbot installation can have one or more masters and multiple workers.

Install Buildbot on Debian 9

In this tutorial, we are going to show you how to install Buildbot master and worker on Debian 9.

Update the System

Before we proceed with the guide, we are going to make sure the package index is updated and all system packages are up to date:

sudo apt-get update
sudo apt-get upgrade

Installing Buildbot

Installing Buildbot with pip is very easy. If you don’t have pip installed on your Debian server, you can install pip and python development packages using the following command:

sudo apt-get install python-pip python-dev

In order to upgrade pip to its latest version, be sure to run the command below:

sudo pip install --upgrade pip

The output will look like the following:

Collecting pip
  Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)
    100% |################################| 1.3MB 82kB/s
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed pip-10.0.1

After pip is installed and updated to the latest version, you may continue with the Buildbot installation.
Buildbot can be installed like any other pip package. If you don’t have pip installed on your Debian server, you can install pip and python development packages with the command below:

Collecting pip
  Downloading https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl (1.3MB)
    100% |################################| 1.3MB 82kB/s
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed pip-10.0.1

After pip is installed and updated to the latest you can continue with the Buildbot installation.
Buildbot can be installed like any other pip package. Run the command below to install Buildbot with pip:

sudo pip install 'buildbot[bundle]'

If the installation goes well, the output will look as it does below:

Installing collected packages: txaio, autobahn, future, PyJWT, attrs, Automat, constantly, idna, hyperlink, incremental, zope.interface, Twisted, sqlalchemy, python-dateutil, MarkupSafe, Jinja2, pbr, sqlparse, decorator, Tempita, sqlalchemy-migrate, buildbot-console-view, buildbot-grid-view, buildbot-waterfall-view, buildbot-www, buildbot-worker, buildbot
  Found existing installation: idna 2.2
    Uninstalling idna-2.2:
      Successfully uninstalled idna-2.2
Successfully installed Automat-0.6.0 Jinja2-2.10 MarkupSafe-1.0 PyJWT-1.6.1 Tempita-0.5.2 Twisted-18.4.0 attrs-18.1.0 autobahn-18.5.1 buildbot-1.1.2 buildbot-console-view-1.1.2 buildbot-grid-view-1.1.2 buildbot-waterfall-view-1.1.2 buildbot-worker-1.1.2 buildbot-www-1.1.2 constantly-15.1.0 decorator-4.3.0 future-0.16.0 hyperlink-18.0.0 idna-2.6 incremental-17.5.0 pbr-4.0.3 python-dateutil-2.7.3 sqlalchemy-1.2.7 sqlalchemy-migrate-0.11.0 sqlparse-0.2.4 txaio-2.10.0 zope.interface-4.5.0

Verify the Buildbot installation

To confirm whether Buildbot was installed correctly or not, run the command below, which should print the Buildbot version:

sudo buildbot --version
Buildbot version: 1.1.2
Twisted version: 18.4.0

Create a new system user for Buildbot

In order to create a new system user and group, which are going to run our Buildbot services, use the command below:

sudo adduser --home /opt/buildbot --shell /bin/bash  buildbot

Configuring the Buildbot Master

Since we have Buildbot installed, we can proceed and create then configure our first Buildbot master.
Before running the next few commands, be sure to switch to the new Buildbot user by typing:

sudo su - buildbot

To create the Buildbot master, type the following command:

buildbot create-master master

The output will look like this:

mkdir /opt/buildbot/master
creating /opt/buildbot/master/master.cfg.sample
creating database (sqlite:///state.sqlite)
buildmaster configured in /opt/buildbot/master

Copy the default sample Buildbot configuration file by using the command below:

cp master/master.cfg.sample master/master.cfg

To be able to access Buildbot’s web interface on your server IP address or domain, you will have to edit the Buildbot configuration file and change the Buildbot URL settings. Open the configuration file:

nano master/master.cfg
c['buildbotURL'] = "http://your_ip_or_domain:8010/"

Do not forget to change your_ip_or_domain to your server IP address or your actual domain.
Execute the command below to confirm the master configuration:

buildbot checkconfig master

If all is good, you will see the output below:

Config file is good!

To initiate the Buildbot master, run the following command:

buildbot start master

If the server initiates successfully, you will see the output below:
Following twistd.log until startup finished..
The buildmaster appears to have (re)started correctly.
After the Buildbot master has restarted, you can access the web interface at:
http://your_ip_or_domain:8010/

Configuring a Buildbot Worker

We will install and configure our first Buildbot worker on the same server as the master.
To create the buildbot worker, called ‘test-worker’, with password ‘pass’ on ‘localhost’, run the command below:

buildbot-worker create-worker worker localhost example-worker pass

The output should look something like this:

mkdir /opt/buildbot/worker
mkdir /opt/buildbot/worker/info

If you want to use a different username (example-worker) and password (pass), you need to update the following line in the master/master.cfg file:
# a Worker object, specifying a unique worker name and password.  The same
# worker name and password must be configured on the worker.

c['workers'] = [worker.Worker("example-worker", "pass")]

Finally, to start the worker, type:

buildbot-worker start worker

If there are no errors, you should see the following output:
Following twistd.log until startup finished..
The buildbot-worker appears to have (re)started correctly.
Finalize the Buildbot installation via web browser
You can now navigate to http://your_ip_or_domain:8010/ and start configuring your Buildbot installation.

Also, here are a few hand-picked guides that must read next:

  1. How to install NextCloud 13 on Debian package 9
  2. How to Install Sentora on Debian 8

One more thing..
Share this tutorial with your hosting administrators and networking experts friends, as it will help them and make my countless hours of work count.
Thanks

Updated on December 23, 2018

Was this article helpful?

Related Articles

Leave a Comment

[apsl-login-lite login_text='Please login with a social account']