Walkthroughs

Here's how to set up continuous integration (CI) for your Oracle database with:

  • The Deployment Suite for Oracle
  • Jenkins or TeamCity

The process and command line hooks explained below should also help you get set up with any CI system.

Prerequisites

Install the Schema Compare for Oracle and Data Compare for Oracle command line interface

To run Schema Compare for Oracle and Data Compare for Oracle from the command line on a build server, you need the Deployment Suite for Oracle.

This will enable the TeamCity or Jenkins build agent to call the Schema Compare and Data Compare commands.

Install Source Control for Oracle

If you're using Git, SVN or TFS for your version control system, Source Control for Oracle removes the manual processes for source-controlling database changes.


Walkthrough video — setting up CI for Oracle with Jenkins



Walkthrough — setting up CI for Oracle with TeamCity or Jenkins

Create a New Project

In Jenkins this is called a job.

Create a new project

Create a Build Configuration

Add artifact paths to produce reports and a deployment script.

In Jenkins this is a post build step to archive files.

PreDeploy.html => Reports
                            				PreDeploy_images => Reports\PreDeploy_images
                            				UpgradeScript.sql => Scripts
                            				PostDeploy.html => Reports
                            				PostDeploy_images => Reports\PostDeploy_images
Create a build configuration

Create and attach a Version Control Settings root

Specify a custom checkout path to use in build steps later.

In Jenkins this a custom workspace, under advanced options.

Create and attach a version control Settings root

Add build steps

In Jenkins these are called Windows batch commands.

PreDeployReport

Compare the contents of Subversion with a live database and generate a report of the differences. Command Line Executable:

C:\Program Files\Red Gate\Schema Compare for Oracle 3\SCO.exe

Parameters:

/source C:\DatabaseCI{WIDGET} /target User/Pass@host{WIDGET} /includeidentical /report:"PreDeploy.html" /reporttype:Interactive

CreateScriptAndDeploy

Create the SQL script and upgrade the target database. Command Line Executable:

C:\Program Files\Red Gate\Schema Compare for Oracle 3\SCO.exe

Parameters:

/source C:\DatabaseCI {WIDGET} /target User/Pass@host{WIDGET} scriptfile:UpgradeScript.sql /deploy

Execute: Only if all previous steps were successful.

Set Build Failure Conditions

Turn off 'fail if build process exit code is not zero'.

Set build failure conditions


Add a new trigger to build on each check-in

Creation scripts checked in to version control need to be generated by either Source Control for Oracle or Schema Compare for Oracle.

Create a deployment script and reports

A build will create a deployment script, and reports, as artifacts.

Create a deployment script and reports