How To: Create a Sandbox Project for Demos or Testing

It is a common practice to create a Liquibase Enterprise “sandbox” project for testing and demonstration purposes. However, it can be burdensome to create new scripts for every demo or round of testing. Here we will show you how to setup your sandbox project so that you can reuse the same scripts repeatedly. This not only saves time, but ensures that your testing and demos will work as expected.

SCM Repos

The master branch of each repo should represent the starting point or baseline for your project. You will clone the master branch to a “demo” branch whenever you want to start over from the project baseline. The “demo” branch should never be merged back to master in order to preserve the baseline configuration.

SQL Repo

The Master branch should have the starting configuration for your SQL Repo. For convenience, you can also store the scripts for testing/demos in a separate folder within the Repo. Packager will ignore files in a folder that does not have a metadata.properties file which specifies the Package Method.

 

 

DDB Repo

The Master branch should have the starting configuration for your project. The changelog should be empty unless you always want to start by deploying a baseline set of changes to the database.

 

 

 

 

 

Databases

Create a baseline configuration for the databases in the “sandbox” pipeline. The databases in the pipeline must contain the DATICAL_USER, DATICAL_TRACKING, and MANAGED schemas. Make sure that the DATICAL_USER and DATICAL_TRACKING schemas have been granted the required permissions. The DATABASECHANGELOG table should be empty. Since this is a sandbox environment, you can keep it very simple and start with empty MANAGED schemas. This is the configuration which will be restored when the project is reset to the baseline.

Datical Project

Create the “sandbox” project using your usual process. The deployPackager.properties file must be configured so that both Repos use the “demo” branch. Commit the baseline configuration to the Master branch of the DDB Repo.

ddbScmSystem=git ddbScmBranch=demo ddbScmPath=. # Default values sqlScmSystem=git sqlScmPath=../demo_sql sqlScmSQLBaseDir=. # Pipeline specific values release.sqlScmBranch=demo release.sqlScmLastImportID=c1f07dc08834df411a5ae495a433e8c6259a3a92

CI/CD

You can use your standard CI/CD jobs. Just make sure that any jobs which clone the Repos use the “demo” branch.

 

Running the Project

  1. Clone Repos to local.

    git clone <gitURL>
  2. Create demo branches from master in each Repo.

    git branch demo git checkout demo git push -u origin demo
  3. Import the Project using Datical DB GUI.
    Remember to use the Demo branch for the project.

  4. Commit and push scripts to the SQL Repo on the demo branch.

  5. Run the CI/CD pipeline.

  6. View reports in DMC

 

Resetting the Project

  1. Delete the Demo branches in the SCM for both Repos.

  2. Truncate the DBCL tables on the databases.

  3. Drop and Recreate the Managed schemas.

 

Copyright © Datical 2012-2020 - Proprietary and Confidential