JasonCreaseThis is a guest post from Jason Crease, an application engineer working in Redgate’s DLM (Database Lifecycle Management) team.

Most application developers are used to the benefits of continuous integration. With tools like Bamboo you can bring your application’s continuous integration and delivery pipeline together in a single workflow. What if you could include database continuous integration in that same workflow?
SQL CI is part of the DLM Automation Suite, a suite of tools from Redgate that let you apply continuous integration and release management processes to Microsoft SQL Server databases. Using SQL CI, you can build, test, synchronize and publish databases. When used from within a continuous integration tool like Bamboo, you can create a smooth process where you build and deploy databases alongside your application code.

SQL CI is a command-line utility that can be invoked directly from a Bamboo command task. However, using command line tasks can be opaque and error-prone, so we’ve made an add-on for Bamboo to make life easier. The Redgate SQL CI plugin provides four build tasks: build, test, sync and publish. Add one or more of these to your job, fill in a few boxes, and you’re all set to go!

To use SQL CI effectively, you need to connect your database to your source control system. The easiest way to do this is with Redgate’s SQL Source Control.

Typically, you’ll end up with a database development process similar to this:

  1. A database managed by SSMS (SQL Server Management Studio)
  2. Use of the SQL Source Control add-on to source control schemas and reference data, and to commit creation scripts to your source control system – these scripts, automatically created by SQL Source Control, describe the current state of your database schema
  3. A Bamboo build plan that gets triggered when you check in changes, and consists of:
  • A SQL CI build task that builds your database into a NuGet package from the database scripts folder in source control
  • A SQL CI test task that runs your tSQLt tests against the database
  • A SQL CI sync task that synchronizes the package to an “integration database”, so everyone can see the latest database state
  • And finally, a SQL CI publish task that publishes the package to a NuGet stream

SQLCIScreenshot

The plugin is available for free from the Atlassian Marketplace. Download the JAR and put it in your “Bamboo installation directory\atlassian-bamboo\WEB-INF\lib” directory. If you don’t  have Bamboo, download a free trial here! It’s easy to set up and run.

You will also need to install Redgate’s DLM Automation Suite, available to download from the Redgate website on a 28-day free trial.

About Redgate:

Redgate Software has specialized in database software for 15 years, developing simple products to solve complex problems. Redgate’s database lifecycle management (DLM) tools help customers overcome the challenges of adding databases alongside applications in agile processes.

Database continuous integration with Bamboo and Redgate SQL CI