Database DevOps for Oracle

Basic CI with TeamCity or Jenkins jobs



This provides a basic example of how to call the Redgate command lines from TeamCity or Jenkins when not using pipelines as code. Although this example calls the sco.exe command line directly, calling a batch file that in turn calls sco.exe is recommended as this allows more complex logic to be added to the workflow.

Create a new project

In TeamCity this is a project. In Jenkins this is called a job.

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 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.

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'.

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.




Didn't find what you were looking for?