1.0. Check-in (and package) your first script

Check in your script(s) in the correct directory.

<sql_code_dir> # for example, sql_scripts
   data_dml
   ddl
ddl_direct function package packagebody procedure sql sql_direct trigger

Commit/push your scripts to SQL repository. As soon as your scripts are pushed a Jenkins job will be triggered to start Datical's packaging process.

Refer to Placing Files in the SCM Repository for more details.

The Packaging process goes through a workflow and validates your script(s) in a REF database (and upon success may automatically deploy into DEV or INT database). The high-level workflow can be described as these stages:

  • Packaging stage:
    • A backup of the REF database is created
    • ddl scripts by default go through a "convert_sql" process which allows Datical to determine what changed in managed schema(s).

      • This requires deploying the ddl scripts into the REF database.

      • The outcome is one or more changesets. 

      • If there are errors with ddl scripts then the REF database will be restored to its initial state.
      • You could optionally change the packageMethod of the ddl folder to ddl_direct (if you don't want to use the default convert packageMethod).
      • All other scripts (data_dml, ddl_direct, stored logic, sql_direct) bypass the "convert_sql" process.
    • REF database is restored to its initial state
    • If packaging stage fails, the overall job stops and returns an error
  • Forecast stage:
    • ddl changesets are forecasted
    • If forecast stage fails, the overall job stops and returns an error
  • Deploy stage:
    • All changes (ddl changesets as well as all non-dll scripts) are deployed to REF database
    • If there are failures during deployment:
      • The REF database is restored to its initial state.
      • Developers will have the opportunity to fix their scripts and try again.
      • Overall job stops and returns an error
    • If all ddl changesets and scripts deploy successfully then non-stored logic files are moved to the archive directory
      • This includes scripts in the following directories: ddl, ddl_direct, data_dml, sql, and sql_direct

Best Practices

These are suggested best practices:

  • Try not to commit large number of scripts at once.
    • This will take longer to package
    • If there are failures during packaging process then none of the scripts will deploy
    • Suggest: Commit fewer scripts 
  • Be cognizant of dependencies
    • Look into Processing Order for how Datical will determine in which order to deploy scripts







Copyright © Datical 2012-2020 - Proprietary and Confidential