ReadyRoll 1

Create VSTS/TFS build

This page walks you through the process of building a ReadyRoll project with Microsoft's VSTS and TFS.

Setting up

Installing the ReadyRoll VSTS/TFS extension

The easiest way to do continuous integration with ReadyRoll using VSTS/TFS is to use the ReadyRoll extension.

Follow the instructions on how to install the ReadyRoll VSTS/TFS extension here.

Setting up a ReadyRoll build definition in VSTS/TFS

Ensure that you have a ReadyRoll project checked into source control on VSTS/TFS. For more information about setting up a ReadyRoll project see Getting started.

There are two ways to set up a ReadyRoll build definition depending on the version of TFS you are using, or if you are using VSTS.

VSTS and TFS 2018 RC1 (and later) users

The easiest way to set up a ReadyRoll build definition is to use the ReadyRoll build definition template.

  1. In VSTS/TFS, create a new build definition
  2. Select the ReadyRoll template
  3. Click Apply

TFS 2015 and TFS 2017 users

These versions of TFS do not support build definition templates, so it's not possible to use the build definition template provided by the ReadyRoll extension.

This means you must set up the ReadyRoll build definition manually.

Configuring the build

Check build tasks

If successful, you should have the following build tasks, in order, in your build definition:

  1. NuGet Tool Installer*
  2. ReadyRoll Download Build Components*
  3. ReadyRoll Set Target Database
  4. Visual Studio Build
  5. Copy Files
  6. Publish Build Artifacts

Note

The tasks described here may differ from the tasks you see in your version of TFS.

If so, it may be necessary to manually update or install the tasks from the Visual Studio marketplace.

Instructions on how to do this can be found here.

*NuGet Tool Installer and ReadyRoll Download Build Components

These two tasks are designed to ensure the agent machine has the latest version of the ReadyRoll Build Components installed. These are optional tasks.

If these tasks cannot be included (for instance, the version of TFS you are using doesn't support one/both of them) you must ensure the agent machine has the ReadyRoll Build Components installed. You can find information about how to do this here.



Choose a build agent

  1. In the Agent queue drop-down, choose a build agent

    The ReadyRoll build definition template will automatically download the ReadyRoll build components to your build agent through the NuGet Tool installer and ReadyRoll Download Build Components tasks.

    If that doesn't work for any reason, or if you would like to control the versioning of build components, you can also install the ReadyRoll build components onto your build agent or solution.

Configure the Target database

The target database is only used for generating the build artifacts and it will not be modified.

It is a database in one of your environments, for example test, staging, or production.

It is required for generating a preview report, generating a diff report, generating a drift report & drift correction script, and generating a patch deployment script.

  1. Click the Set Target Database build task

  2. Fill in the fields for the target database you have chosen

Configure the Shadow database

In order to validate the migration scripts and to generate reports & a drift correction script, a shadow database is required during a build.

The shadow database is a temporary database where ReadyRoll can run your migration scripts.  By running the migration scripts on a real database, SQL Server will check that they are valid SQL with no syntax errors, missing dependencies, etc.

It's often easiest to use LocalDB for the shadow database, and so the ReadyRoll build definition template is pre-configured to use LocalDB (if needed, you can choose other options under Advanced).

Configure triggers

  1. Click the Triggers tab
  2. Choose the triggers, for example, most people enable the Continuous Integration trigger

Finally

  1. Click Save & queue
  2. In the dialog, click Queue

Next steps

For details on how to get started with automated releases on VSTS/TFS, see Create VSTS/TFS release.

Didn't find what you were looking for?