Defining Your VSTS Build

The build definition in VSTS is designed to build and compile your code and then take the resulting build and save them to an artifact store. You can create build definitions for Visual Studio applications, XCode applications, Android applications and, of course, Java applications. In VSTS go to the Build & Release section of your project and then make sure you are on the Builds tab. Click on the New Definition button to get started.

You should see a list of predefined build templates, the one that we are interested in is the Maven template so I’m going to go ahead and select that one as my starting point. The default Maven template should pretty much work as is but I’m going to make a few minor changes so that it will always build on our new VSTS Build Agent.

First lets make sure that we are building the right thing. On the Tasks tab you should see what sources it is building. It should say the name of your repository and the master branch. If not then select the correct branch.

Over on the Triggers tab you should enable the Continuous Integration section. This will make sure that a build is triggered every time new code is pushed to the master branch. You can also setup scheduled builds so if you have some sort of nightly build process you can automate that here.

The Options tab contains the section that we need to specify the build agent. When we started the VSTS Build Agent it was created in the ‘Default’ agent queue so make sure you have selected that as your queue and you have not selected either of the hosted options.

If you have multiple private build agents and not all of them are based on the Rancher VSTS Build Agent then you will need to add a ‘Demand’. When the build is queued it will look for a build agent that meets all the required demands, this is how you can make sure that Visual Studio builds run on windows boxes and XCode builds run on OS X boxes.

The Rancher VSTS Build Agent sets an environment variable of RANCHER_CLI_VERSION so I’m adding a demand to ensure that this exists. I’m not using any specific Rancher features during the build process but I know that the agent has Maven on it so it is a logical choice to use that agent.

I can now save my build definition and run it for the first time. The build process will start on the different stages and your screen will update as each stage completes ( or fails ). Once completed you can select any of the stages on the left side to review the logs for that stage.


Now that we have a successful build we can start the process of deployment.

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