A VSTS Build Agent For Rancher

By default Visual Studio Team Services provides you with one hosted pipeline and one private pipeline when you are using the free services. You can add additional pipelines at a cost of $15 a month if you need them however a single pipeline should work ok for a small team.

The private pipeline is something that you run on your own infrastructure and Microsoft provides pipeline agents that will run on Windows, OS X and Linux machines. These agents will listen to your VSTS account and accept jobs for running build and releases. For the purposes of the Rancher/Docker infrastructure I am running a private build agent on a Ubuntu Linux box with some additional Rancher API access features added in and I’m also running it on my Rancher Infrastructure.

First we need to add a stack to run our service in. In the development environment click the Add Stack button. I’m going to called mine ‘tools’ and then just create an empty stack.

2017-02-26_14-58-55

Next I click on the ‘Add Service’ button.

To save a some time Microsoft already provides their Ubuntu VSTS Agent as a docker image so you can easily use this as your starting image. To save even more time, however, I have built my own personal docker image that is based on the Microsoft image and adds in the Rancher Command Line Interface and an addition Rancher API script that can do a few things that the Rancher CLI currently can’t do.

If you want to look at the DockerFile it is available in my GitHub repository and the image is available on Docker Hub.

Don’t forget to add your VSTS Environment variables to the container before you start it up or it will fail.

Once you have it running you will see it listed in the tools stack

Now we can start getting VSTS to build our application on our private pipeline box.

Advertisements
Tagged with: ,
Posted in Domino To Spring
Archives
%d bloggers like this: