Introducing a Buildbot status plugin for pushing status updates to Logentries

build-bot-intergration

Buildbot is a framework for building continuous deployment and integration systems, it is highly flexible and is written in python. It is also a mature system which a number of large projects use e.g. Mozilla, Chromium, Python – see trac.buildbot.net/wiki/SuccessStories

To send build status information — specifically Start, Success and Failure states from Buildbot to Logentries — start by generating a log token from Logentries.

Assuming that you have an existing Buildbot installation, we can enable the Logentries status plugin for Buildbot.

pip install buildbot_status_logentries

Once the package is installed into your python environment, two additional lines are needed in your master.cfg configuration file.

from buildbot.plugins import * 
c['status'].append(status.LogentriesStatusPush(api_token="c1481e42-75b3-4772-bb7a-db92691d74e9", endpoint="data.logentries.com", port=10000)

If you require TLS:

from buildbot.plugins import * 
c['status'].append(status.LogentriesStatusPush(api_token="c1481e42-75b3-4772-bb7a-db92691d74e9", endpoint="data.logentries.com", port=20000, tls=True)

Once the master is configured with this new status notifier, restart the Buildbot master. Whenever a job kicks off, a Start, Success or Failure message is sent to the Logentries service.

Here’s a sample logline that is sent by the plugin to Logentries:

url=http://buildbot.local.net:8010/builders/runtests/builds/101 buildername=runtests result=STARTED reason='A build was forced by 'admin <admin@localhost>': reason='Forced deployment'

Additional information can be found at:

Ready to try it yourself? Create your free Logentries account within 5 minutes at logentries.com/get-started.

Posted in How To, Monitoring

Leave a Reply