SQL Change Automation 4

Use the Bamboo add-on with a SQL Source Control Project

This tutorial takes you through each stage of setting up a database pipeline using Atlassian Bamboo and the SQL Change Automation Bamboo pluginYou'll use the plugin to build, test, sync and publish a SQL Source Control project.

1. Prerequisites

Make sure you have the following:

2. Install the SQL Change Automation plugin

3. Add a Build task

You'll add the build step using one of Redgate's build plan for Bamboo. 

  • Create a plan. See Creating a plan.
  • In Configure tasks, click Add task
  • Click Redgate SQL Change Automation Build task
  • Under Database project, select one of the following options:
    • Database folder is in my build VCS root
    • Database folder is a subfolder of my VCS root
      Then provides the path to your SQL Source Control folder relative to your checkout directory
  • Under Build artifact, enter a name for the NuGet Package ID. This is the name of the NuGet package you'll create. The name must be unique and can't contain spaces.
  • Under Temporary database server, select SQL Server if you have features in your database that are not supported by LocalDB. 
    By default SQL Change Automation uses LocalDB to recreate and validate a temporary version of your database. The temporary database is dropped once the build is complete.
  • (Optional) If you're using  Redgate's DLM Dashboard (version 1.4.4.313 or later) , SQL Change Automation can send schema information to it every time the build step runs.

    Under DLM Dashboard Integration:

    • Enable the Send schema information to DLM Dashboard check box.
    • Enter the name or IP address of the machine hosting the DLM Dashboard. 
    • Enter the DLM Dashboard port number. The default port is 19528.

    For more information about how SQL Change Automation works with DLM Dashboard, see 
     SQL Change Automation integration.

  • (Optional) SQL Change Automation can include SQL Doc database documentation in the NuGet package that it builds. To select this option, under Database documentation, click Include database documentation.
  • (Optional) Specify SQL Compare options to run on the command line. Options should be specified as a comma-separated list, with a minus sign in front of any default options you wish to negate.
  • (Optional) Specify SQL Data Compare options to run on the command line. Options should be specified as a comma-separated list, with a minus sign in front of any default options you wish to negate.
  • (Optional) Specify the Output folder, Transaction Isolation Level and the Query Batch Timeout.
  • (Optional) Under SQL Change Automation version, select Specific and provide the specific version of SQL Change Automation that will be used. By default, the latest version is used.
  • Click Save

4. Add a Test task

The test step allows Bamboo to run tSQLt tests included in your database. For more info read tSQL and SQL Test.

  • Edit your plan.
  • In Configure tasks, click Add task
  • Click Redgate SQL Change Automation Test task
  • Under Test source, select Test a build artifact from a SQL Source Control project using tSQLt tests
    • Insert the NuGet Package ID. This must be the same ID used to configure the Build step.
  • Under Temporary database, select SQL LocalDB. If you need a custom SQL Server, select SQL Server and provide additional connection details.
  • For the Run tests option, select Run every test.
  • (Optional) Check Generate test data before testing if you intend to automatically populate the database with test data.
  • (Optional) Specify SQL Compare Options, SQL Data Compare Options, SQL Compare filter, Transaction Isolation Level and Query Batch Timeout if needed.
  • (Optional) Under SQL Change Automation version, select Specific and provide the specific version of SQL Change Automation that will be used. By default, the latest version is used.
  • Click Save

5. Run a Build

  • Open your Build Dashboard
  • Click on your project
  • Click on the run icon for the plan. See Running a plan build.

6. Add a Sync task

  • Edit your plan.
  • In Configure tasks, click Add task
  • Click Redgate SQL Change Automation Sync task
  • Under Build artifact to sync, insert the NuGet Package ID. This must be the same ID used to configure the Build step.
  • Under Target database, enter the name of the target server and database you want to update and the SQL Server credentials if needed.
  • (Optional) Under Output artifact, check Output the update script used during deployment if needed
  • (Optional) Provide SQL Source Control project options if needed
  • (Optional) Under SQL Change Automation version, select Specific and provide the specific version of SQL Change Automation that will be used. By default, the latest version is used.
  • Click Save

7. Add a Publish task

  • Edit your plan.
  • In Configure tasks, click Add task
  • Click Redgate SQL Change Automation Publish task
  • Under Build artifact to publish, insert the NuGet Package ID. This must be the same ID used to configure the Build step.
  • Under NuGet Feed, provide the NuGet feed URL
  • Click Save

Didn't find what you were looking for?