Use Case
Tonic how-tos

Integrating Tonic into your data refresh and CI/CD pipelines

Nick Rios
March 22, 2024
In this article

In today's fast-paced development environments, it is paramount to ensure data consistency and integrity, as well as comprehensive security, across all stages of development, testing, and production. Tonic provides a robust platform, purpose-built for this landscape, offering data de-identification, subsetting, and ephemeral environments to generate realistic and on-demand datasets that are privacy-compliant. This article explores some examples of how customers can leverage this powerful toolset to enhance their workflows.

Automated data refresh for development environments

Imagine a scenario where your development team needs fresh, anonymized data every morning. Using Tonic, and the template scripts from the tonic-workspace-automations repository shared below, you can set up a scheduled job (e.g., via cron or CI/CD tools like Jenkins, GitLab CI, or GitHub Actions) that:

  • Pulls the latest production data into a staging database.
  • Triggers Tonic Structural’s data anonymization process via the Tonic API.
  • Updates the development database with the newly anonymized data.

This ensures that your development environment regularly reflects current production trends without exposing sensitive information.

Furthermore, capabilities like our patented subsetter or Tonic Ephemeral can drastically reduce infrastructure costs and management headaches - keeping developer enablement at the heart of your strategy without cutting corners with Infosec.    

  • Tonic Structural’s subsetter is a uniquely engineered and patented technology for optimizing test data management by reducing databases to manageable sizes without losing referential integrity, thus enhancing developer productivity, reducing storage costs, and accelerating development timelines​.
  • Tonic Ephemeral is designed specifically for the rapid deployment and management of ephemeral data environments, allowing the instant spin-up and down of fully hydrated test and development databases. This streamlines the development process, significantly reduces costs, and eliminates lengthy ticketing processes, making it an ideal solution for modern development needs.

Integrating Tonic into CI/CD pipelines for automated testing

For teams practicing Continuous Integration, maintaining up-to-date test data is crucial. By integrating Tonic into your CI pipeline, you can:

  • Trigger a data anonymization process in Tonic Structural as part of your build pipeline.
  • Once anonymization is complete, automatically fetch the data and populate your  test databases.
  • Run your automated test suites against this data to validate changes with realistic datasets.

This approach reduces manual intervention, enhances testing accuracy, and ensures privacy compliance.

Dynamic environment setup for feature branches

In a GitFlow-based workflow, developers often need separate environments for new features. Leveraging tonic-workspace-automations, you can create a pipeline that:

  • Detects new feature branches automatically.
  • Creates isolated, anonymized datasets specific to each feature.
  • Tears down or refreshes data when branches are merged or deleted.

This enables a scalable, data-driven approach to testing new features in isolation, improving code quality and reducing cross-feature conflicts.

Once again, the Tonic’s subsetter can play a pivotal role here in minimizing data size while maintaining utility. In tandem with that,Tonic Ephemeral can be leveraged to simplify the deployment strategy for these datasets. 

Automating data anonymization with

The tonic-workspace-automations repository contains scripts and workflows designed to automate the process of fetching, anonymizing, and updating data within Tonic Structural workspaces. Building upon the code here can allow you to more easily build out the examples above.

Additional resources include:

Key components of the repository:

  • Tonic Configuration: Automate the configuration of Tonic Structural workspaces, including data connections, table selections, and anonymization settings.
  • Tonic Session: Methods to automate interactions with the Tonic API and to more easily integrate Structural with other services. 

Leveraging Tonic Structural example scripts

To start integrating these automations, follow these steps:

  1. Clone the tonic-workspace-automations repository: Access the scripts and workflows designed for Tonic integration.
  2. Customize scripts for your environment: Modify the provided scripts to connect to your databases and Tonic Structural workspace. Set up necessary authentication, endpoints, and data mapping according to your infrastructure.
  3. Incorporate scripts into your existing pipelines: Integrate these scripts into your CI/CD platform of choice. Use conditional triggers, environment variables, and pipeline parameters to tailor the workflow to your team’s needs.
  4. Monitor and refine: After integration, monitor the performance and impact of these automations. Collect feedback from developers and testers to refine the data sets and anonymization rules.
  5. Maintain compliance and security: Regularly review the anonymization settings and data handling practices to ensure compliance with data privacy regulations and internal policies.


Integrating Tonic’s portfolio of products into your existing data refresh and CI/CD pipelines can significantly enhance your development and testing workflows. By expanding on the tonic-workspace-automations repository, teams can automate the creation of secure, realistic datasets, enabling more accurate testing and development processes while maintaining data privacy and compliance.

Build better and faster with quality test data today.
Unblock data access, turbocharge development, and respect data privacy as a human right.
Nick Rios
Solutions Architect