Organize a DevOps process using the dbForge DevOps Automation Jenkins Plugin

dbForge DevOps Automation for SQL Server is a solution designed for the management and deployment of changes to a SQL Server database. With dbForge DevOps Automation for SQL Server, you can automate the deployment of database changes and build a full-cycle database CI/CD pipeline using any continuous integration or continuous deployment server that supports running PowerShell. To simplify setup, dbForge DevOps Automation includes plugins for Jenkins automation servers.

dbForge DevOps Automation comes as part of the SQL Tools suite and is used in conjunction with dbForge Studio or other dbForge tools, such as Unit Test, Data Generator, Data and Schema Compare. dbForge DevOps Automation allows organizing a comprehensive continuous delivery pipeline for your database.

Build a CI/CD pipeline with Jenkins

dbForge DevOps Automation Jenkins Plugin provides all the necessary features to configure Continuous Integration. It allows you to create a database on the server, test it, and deploy.

The guide provides step-by-step procedures to create the Jenkins job using the dbForge DevOps Automation Jenkins Plugin for SQL Server.

Prepare the environment

  • Download and install dbForge DevOps Automation for SQL Server.
  • Download and install dbForge Studio on the computer that will act as a build agent.
  • Install and configure the Jenkins server.
  • Download and install the dbForge DevOps Automation for SQL Server PowerShell module, which provides a set of the PowerShell cmdlets to coordinate dbForge Tools, from the PowerShell website or from the Devart website. Click Download next to Jenkins.
  • Download the Windows PowerShell plugin for Jenkins from the Devart website. Click Download next to Jenkins.
  • Install the dbForge DevOps Automation for SQL Server plugin for Jenkins.

Create a new SQL Continuous Integration job

After you have installed the plugin, you can create a Continuous Integration job based on it.

To create a job:

1. On the Jenkins main page, click New Item.

2. Enter a project name, select a project type, then click OK.

Note

Freestyle project is displayed as an example of the project type.

Start the project

3. Configure the job settings in the following sections:

  • General

1. Enter the project description.

Enter the project details

2. Click Advanced.

3. Select Use custom workspace and under Directory, enter the path to your working folder.

Note

The working directory is expected to include a subfolder containing the scripts directory. It is also assumed that a version control system is configured to pull the latest changes for this subfolder.

Alternatively, retrieving new changes can be configured as a separate job in Jenkins.

Configure the working folder settings

  • Triggers

Select the automated actions that start your build based on specific events, like code changes or scheduled times.

Specify the build triggers

  • Build Steps

1. Build a database package.

Configure the Build step

2. Test the database using tSQLt.

Configure the Test step settings

3. Publish a database package.

Configure the Publish step settings

4. Click Save.

Trial run of your project

Launch your project and check the results.

1. In the navigation menu on the left, click Build Now.

Run your project

2. To check the result, under Builds, click the arrow next to the required build number and select Console Output.

Check the result

Create the Execute step

You can use the Execute step to:

  • Create a database from custom scripts.
  • Run migration scripts to update a deployed database.
  • Add unit tests for the deployed database.

To create the Execute step, use dbForge DevOps Automation for SQL Server - Execute.

Video tutorials

Watch these videos to learn how the dbForge tools can be involved in the Continuous Integration process.

  • How to import data to SQL Server database with dbForge Data Pump during the DevOps process
  • Creating database documentation during the Continuous Integration workflow
  • How to automate database schema changes for the CI process during database deployment
  • dbForge Source Control in the DevOps pipeline
  • Unit Testing for SQL Server Database in DevOps process