The ReadyRoll build components depend on the migration scripts created by the Visual Studio extension.
The ReadyRoll build components work with any continuous integration server (eg, VSTS/TFS, TeamCity, Jenkins, Bamboo, etc), and let you:
- build the database alongside an application as part of a continuous integration process
- validate the migration scripts
- run tSQLt tests, integration tests, etc
- create a package used by the release components
- Any continuous integration server that can run MSBuild
- For build-time migration script verification, then on the agents:
- Microsoft SQL Server Native Client (x86/x64)
- Microsoft Command Line Utilities for SQL Server (x86/x64)
- After installing the above, the machine (or agent process) must be restarted: the above installer adds the utility to the PATH system environment variable, enabling ReadyRoll to find and execute the SqlCmd utility.
The build components need to be installed on your build agents.
There are a couple of options available to you:
Option A – Install the ReadyRoll Visual Studio extension on each build agent:
If you have admin and remote desktop access to your build agents, you may find this to be the simpler of the two options.
Install the ReadyRoll build components on each build agent by downloading and installing the ReadyRoll Visual Studio extension (eg, via remote desktop).
Or, Option B – Use the ReadyRoll.MSBuild NuGet package:
If you don't have admin access to your build agents, or if you would like to control the versioning of your build-time dependencies, ReadyRoll also allows you to install the build components using the ReadyRoll.MSBuild NuGet package:
- In Visual Studio, open the Package Manager Console by clicking View then Other Windows then Package Manager Console.
In the Package Manager Console, enter:
Resolving the error "Project 'Default' is not found"
If you get the error:
Install-Package : Project 'Default' is not found.
Then the simplest way to resolve this is to add a blank new C# Class Library project to your solution and try installing the package again.
This error occurs because ReadyRoll projects don't support NuGet (because ReadyRoll depends on SSDT which is not supported by NuGet), and also, as of Visual Studio 2015, NuGet requires that a NuGet-compatible project be included in the solution prior to performing the package installation.
- In the Solution Explorer, right-click the ReadyRoll database project, then click Unload Project.
- In the Solution Explorer, right-click the ReadyRoll database project, then click Edit ....sqlproj
In the .sqlproj file, find the
<ReadyRollTargetsPath>definition, and replace it with:
The above ReadyRollTargetsPath string assumes that your solution file (.sln) is in the parent folder of the ReadyRoll database project .sqlproj file. If the solution file is not in the parent folder, then you will need to modify the relative path in the above string as appropriate (that is the part that contains the sub-string "..\packages").
- Save the file.
- In the Solution Explorer, right-click the ReadyRoll database project, then click Reload Project.
- In the dialog box, click Yes.
- To confirm that the build components have been successfully installed, Rebuild Solution, then in the Output window, find the line containing "Using ReadyRoll toolpath" and check that the file is within your solution's packages directory.
Commit the changes to source control.
You will either need to do a NuGet restore during build, or also commit the packages folder to source control, just like with any other NuGet reference.
You have now completed using the ReadyRoll.MSBuild NuGet package.