I helped to build a simple one-field one-click server provisioning process for triPOS cloud developers to help create extra environments for dev and QA testing. However, I felt like the process could be streamlined by creating a chat bot. I wanted a system that could show the breadth of what ChatOps could do for us by taking on a one of the more complex problems we deal with - standing up new server environment.

What it does

I created a chat bot that responds to Slack messages with the capacity to do builds, server provisioning and deployments.

How I built it

I created an outgoing webhook in Slack that responded to any phrase that started with "BB" or "BuildBot". Slack then sent any phrase typed in with 'bb', such as 'bb help', to my Azure Functions, a serverless technology.

Azure Functions allowed me to quickly iterate on my ideas with a series of micro-services. I parsed the input from Slack in my Azure Functions and when appropriate I would make calls to Visual Studio Team Services (VSTS) to get a list of projects, a list of builds, deploy an application, etc.

For the deployments, I created a special TFS build and release pipeline that would allow me to create an ad hoc environment so I could have environments on demand. Because the environments were dynamic in nature, I needed a way to communicate back to the end user what the address of the new websites were, so I created an incoming hook for Slack that received messages from VSTS via the Azure Functions.

Challenges I ran into

VSTS/TFS is rapidly changing, so documentation is changing in order to keep up with new features - this is both good and bad, but I was a bit nervous on being able to complete 100% of my vision. In addition, I did not want to use any of the client libraries in case I ran into edge cases, so I had to rely on taking the time to learn how Slack and VSTS worked.

Accomplishments that I'm proud of

Representing the spirit of our DevOps team who would have loved to have helped but were engaged in production and stabilization work.

What I learned

This project wouldn't have come together without a lot of PowerShell and C# - each one having their distinct place in how best to solve a problem. And while we may be able to replicate some effort on premise, I definitely saw how critical it is to be open to embracing other platforms and fully embracing the cloud services for their constant updates to their platforms.

What's next for BuildBot?

Theres a lot of extra typing you have to do for BuildBot because of it's more open nature to allow you to explore the projects, builds and releases on VSTS. While this was a useful POC for exploring how we could use a bot for deployments and server maintenance, I think the real power lies in very small bots that help to simplify how we get to the data we need without overly complicated UIs. I'd like to see bots that can tell us the status of servers, create SSL certs for developers, alert when servers are down, submit IRIS tickets for removing and adding users to distros - essentially helping make the answers/solutions more readily available to devs, ops and analysts.

Built With

  • azure-arm-templates
  • azure-functions
  • powershell
  • slack
  • visual-studio-team-services
Share this project: