How to Install and Configure Buildbot on CentOS 7

How Does It Work?

Prerequisites

Setting Up Your Alibaba Cloud ECS Instance

# sudo yum update
# sudo yum install nano

Upgrade Pip

# sudo pip install --upgrade pip

Install Required Development Tools

# sudo yum groupinstall 'Development Tools' -y

Install Buildbot

Install Master

# sudo pip install Buildbot
# sudo pip install buildbot[tls]

Install Worker

# sudo pip install buildbot-worker

Create Buildmaster

# buildbot create-master -r buildbold
# cd buildbold
# sudo cp master.cfg.sample master.cfg

Create Buildbot-www

# sudo pip install buildbot-www

Create Buildbot Views

# sudo pip install buildbot-waterfall-view
# sudo pip install buildbot-grid-view
# sudo pip install buildbot-console-view

Setup Firewalls for HTTP, HTTPS, and Other Ports

Troubleshoot Misconfigured URL

# sudo nano master.cfg
c['buildbotURL'] = "http://localhost:8010/"
c['buildbotURL'] = "http://47.254.152.126:8010/"

Install MariaDB

# sudo yum install mariadb-server -y
# sudo systemctl enable mariadb
# sudo systemctl start mariadb

Install MySQL-Python

# sudo pip install mysqlclient

Create Database

# sudo mysql -u root -p
CREATE DATABASE buildbot CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'buildbot'@'localhost' IDENTIFIED BY 'Password';
GRANT ALL PRIVILEGES ON buildbot.* TO 'buildbot'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Configure Database

# sudo nano master.cfg
mysql://buildbot:Password@localhost/buildbot?max_idle=300
c['buildbotNetUsageData'] = None
# sudo buildbot checkconfig

Start Buildbot

# sudo buildbot upgrade-master /home/aareez/buildbold
# sudo buildbot start

Enable Authentication System

# sudo nano master.cfg
c['www']['authz'] = util.Authz(
allowRules = [
util.AnyEndpointMatcher(role="admins")
],
roleMatchers = [
util.RolesFromUsername(roles=['admins'], usernames=['aareez'])
]
)
c['www']['auth'] = util.UserPasswordAuth({'aareez': '654321'})
# sudo buildbot restart

Setup Worker

# sudo nano master.cfg
# sudo buildbot-worker create-worker ~/worker localhost example-worker pass
# sudo buildbot-worker start ~/worker

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store