Deployment Manager - 1.0

 

Creating database packages in TeamCity - Deployment Manager

If you are using TeamCity as a continuous integration server, you can use the Red Gate TeamCity plugin to automate the creation of database packages. To use the plugin, you must have:

In the following example, we have already set up a build for our database in TeamCity. For information on how to install the plugin and set up a database build, see: Setting up a database build in TeamCity.

To set up the TeamCity plugin to create packages:

  1. In the TeamCity plugin, under Source-controlled database, specify the location of your database folder.

    Your database folder is the folder where your database is stored in source control. In the example below, our database folder is our build VCS root in TeamCity:

  2. Under Continuous Integration setup, select the Generate database creation script check box:

  3. If you want to upgrade the database using static upgrade scripts, select the Generate upgrade scripts check box:

    More information on how Deployment Manager upgrades databases

  4. Under Deployment Manager, select the Create a Database Package check box:

  5. In the Package ID box, enter the name of the package you want the build to create.

    Note that you cannot upgrade databases from previous versions that use a different package name.

    Packages are named with the convention <package ID>.<build number>, for example: WidgetDev.1.0.nupkg

  6. In the Server URL box, enter the URL for your Deployment Manager web interface, for example: http://my-server-name:82
  7. In the DM API key box, enter the API key for your Deployment Manager user account.

    For information on how to find your API key, see: Finding your API key.

Your TeamCity build is now set up to create database packages.

Publishing packages

If you are using TeamCity as a NuGet server, packages are automatically published to the TeamCity NuGet feed when the build runs.

To enable the TeamCity NuGet server:

  1. In TeamCity Administration, under Integrations, click NuGet Settings:

  2. On the NuGet Server tab, click Enable:

    The URLs for your TeamCity NuGet feed are displayed. To use this feed with Deployment Manager, you need to add it as a package repository in the Deployment Manager web interface.

If you want to publish the database packages to a different feed, you need to add a NuGet Publish build step to your database build in TeamCity.

Deploying database packages

To deploy database packages, you need to specify some variables in Deployment Manager.

Was this article helpful?

Search support
Forums