Tchater maintenant avec le support
Tchattez avec un ingénieur du support

Toad Edge 2.2 - User Guide

Creating Build Steps - Jenkins

IMPORTANT: To execute build steps correctly, Toad Edge requires a 64-bit installation of Java Development Kit (JDK), however, 32-bit Java is usually used by default. It is therefore necessary to create a JAVA_HOME system variable pointing at 64-bit JDK directory. Please do the following steps to perform the configuration:

  1. Right-click This PC and select Properties | Advanced System Settings | Environment Variables
  2. Click New in System Variables
  3. In the Variable Name field, enter JAVA_HOME
  4. In the Variable Value field, enter your JDK installation path, e.g. C:\Progra~1\Java\jdk1.8.0_65

Creating build steps in Jenkins is easier than in other CI/CD systems since Toad Edge provides its CI/CD functionality in the form of a Jenkins plugin. This topic explains how to install the plugin and use it to create build steps.

The Toad Edge Jenkins plugin can be downloaded here.

To install and configure Toad Edge plugin in Jenkins

  1. In Jenkins, go to home page and select Manage Jenkins from the left menu
  2. Select Manage Plugins
  3. Switch to the Available tab and type Toad Edge into the Filter box
  4. Check the checkbox next to the Toad Edge plugin name and then select Install without restart or Download now and install after restart
  5. Once the plugin is installed, download Toad Edge JAR file with additional libraries in zip archive from here

You will now need to configure the plugin:

  1. In Jenkins, go to home page, then select Manage Jenkins from left menu
  2. Select Configure System
  3. Scroll down until you see Toad Edge for Jenkins. Fill in the path to the Toad Edge zip archive that contains the JAR file and a library folder


  4. Save or Apply the changes

With the plugin installed and configured, you can start creating new build steps.
In this example, we are going to create a new Generate create SQL script build step. We assume that a project has already been created in Jenkins.

To create a new build step (Generate create script) in Jenkins

  1. In Jenkins, click on your project, and select Configure from the left menu.
  2. On the configuration page, scroll down to the Build section
  3. Click Add build step and then select Toad Edge: Generate Create Script
  4. Enter the path in Input file/folder field. The input can be:
    • Connection XML file

      NOTE: Connection XML files can be obtained by exporting a build step in CI/CD Wizard.

    • Repository folder structure
    • Snapshot file
  5. In the Output file, enter the destination folder and the file name for the generated create script

  6. Save or Apply the changes.
  7. Build the Project and you should see the generated create script file in the destination folder

Creating Build Steps - Other Systems

In case you are not using Jenkins, you can still take advantage of Toad Edge CI/CD build steps as long as your system is able to execute batch files/shell scripts.

This example illustrates how to create a Create Snapshot build step and use it in TeamCity.

To create a new build step in TeamCity using Toad Edge CI/CD Wizard

  1. In Toad Edge, click the CI/CD (Continuous Integration and Delivery) button on main toolbar to open the CI/CD Wizard





  2. Select Create Snapshot from the available builds
  3. Configure the path to toadedge.jar (obtained from here). The exported batch/shell script will use this path to look for the jar file, so enter the path relative to the path of the script (Export Path in the last dialog).
    • We choose to set Export Path to N:\TeamCity\working_directory
    • The toadedge.jar file will be located in N:\TeamCity\working_directory\jars
    • Therefore, the toadedge.jar file path will be .\jars (relative) or N:\TeamCity\working_directory\jars (absolute)
  4. In the next dialog, select the Connection and Database that you would like to take a snapshot of
    • The connection is exported as an XML file. If we choose to place it in a different folder than the exported script, we have to modify the Connection File Name path in the same way as in step 3
  5. You can also change the Output file name and path (relative to the Export Path)
  6. In the final dialog, configure the Export Path first. This is the destination folder for the exported script and other files
  7. Now change the Command File Name if you wish. The suffix of the file name determines whether the file will be a batch file (.bat) or a shell script (.sh)

    • Since we are running TeamCity on Windows, it is better to use batch script format. On Linux, shell script would be a better choice

The rest of the configuration is done in TeamCity. This guide assumes that you have already created a Project and a Build Configuration.

  1. In TeamCity web UI, locate your Project and a Build Configuration to which you would like to add a new build step

  2. Open the Build Configuration and select Build Steps from the left menu
  3. Click the Add build step button
  4. From the Runner type dropdown menu, select Command Line
  5. The fields that you now need to configure are:
    • Working directory (you might need to click Show advanced settings) - this is the directory where TeamCity will look for and execute the batch/shell script (in our case, same as Export Path in CI/CD Wizard)
    • Run - select Executable with parameters
    • Command executable - enter the name of the script here (with or without the suffix)

  6. Once you are done with the configuration, Save the changes
  7. Run the Build Configuration to see if everything is configured correctly. If the build step is executed successfully, you should see the newly generated snapshot in the script folder

CI/CD Wizard

Continuous Integration and Delivery Wizard

The CI/CD Wizard guides you through the process of creating and customizing various build steps. It saves you the hassle of having to manually write a script with appropriate arguments to use with the Toad Edge® command line interface.

The generated script can be viewed at any time in the wizard by clicking the Command Preview button.

The following table lists all currently available build steps and files/configuration required to export them.

Build Step Requirements Description
Empty database
  • Database connection file (XML)

Executes a query that drops all objects in the selected database

Create snapshot
  • Database connection (XML file)

Stores the structure (not data) of the selected database as a JSON file. The Snapshotscan be used as a backup

Create baseline
  • Database connection (XML file)

Stores the structure (not data) of the selected database as a JSON file. This snapshot can be used as a backup or as a baseline for the Compare database with baseline build step

Generate create SQL script

One of the following:

  • Database connection (XML file)
  • Repository (folder structure)
  • Snapshot (JSON file)

Generates a create SQL script from a repository, saved snapshot or a database. The script can be used to recreate the structure of the source (not data)

Generate change SQL script
  • Schema Compare result (folder with JSON files)

Generates a change SQL script to deploy changes to the Schema Compare target based on differences found in the previously executed Compare database schemas build step

Compare database schemas
  • Recent Schema Compare
  • Saved Schema Compare (.compare file)

Or two of the following:

  • Database connection (XML file)
  • Repository (folder structure)
  • Snapshot (JSON file)

Compares two different schemas (from databases, repositories or snapshots). The results are stored in a folder that can be used as an input for other build steps

Compare database with baseline

One of the following:

  • Database connection (XML file)
  • Repository (folder structure)
  • Snapshot (JSON file)

And also a baseline snapshot (JSON file)

Compares the given database with the given baseline snapshot. In case any differences are found, an error is raised and the build step will fail

Deploy SQL script
  • Database connection (XML file)
  • Input SQL file

Executes any SQL script on a selected database

Generate HTML comparison report
  • Schema Compare result (folder with JSON files)

Generates an HTML report based on the results of the previously executed Compare database schemas build step

 

Toad Edge Command Line Interface

Toad Edge® command line interface

IMPORTANT: To execute build steps correctly, Toad Edge requires a 64-bit installation of Java Development Kit (JDK), however, 32-bit Java is usually used by default. It is therefore necessary to create a JAVA_HOME system variable pointing at 64-bit JDK directory. Please do the following steps to perform the configuration:

  1. Right-click This PC and select Properties | Advanced System Settings | Environment Variables
  2. Click New in System Variables
  3. In the Variable Name field, enter JAVA_HOME
  4. In the Variable Value field, enter your JDK installation path, e.g. C:\Progra~1\Java\jdk1.8.0_65

The core Continuous Integration and Delivery (CI/CD) functionality in Toad Edge is provided by its command line interface (CLI). Although the best way to use it is to use the CI/CD Wizard, you can also work with it manually.

To use Toad Edge CLI manually

  1. Download a zip archive containing Toad Edge JAR file and other libraries from here
  2. Extract the archive
  3. Launch the command line utility (Windows) or the terminal (Linux) and navigate to the folder with the JAR file
  4. Execute the JAR file with Java command and additional arguments

Every usable command begins with java -jar toadedge.jar followed by the operation you want to perform and additional arguments.

The available operation arguments correspond to the build steps available in the CI/CD Wizard:

  • -compare
  • -report
  • -sql_change
  • -sql_create
  • -deploy
  • -snapshot
  • -baseline

The operation argument has to be followed by other arguments specifying input, output, settings, etc. To learn which arguments you need to use to perform a specific operation, add the -help argument at the end of your command.

Once you supply all the necessary arguments, you can start performing CI/CD actions without having to launch Toad Edge itself.

Documents connexes

The document was helpful.

Sélectionner une évaluation

I easily found the information I needed.

Sélectionner une évaluation