Skip to main content

Set up Sandboxes in your CI/CD system

Introduction

In this guide, we will cover how you can set up the infrastructure necessary to create sandboxes automatically with your CI/CD system - typically for creating new sandboxes for every pull requests and the process of rolling this out to an engineering team.

Pre-requisites

Before you start with the integration of Signadot with your CI/CD pipeline, there are a few pre-requisites that you need to have in place:

  1. Build an Image for Every Pull Request: Signadot uses the images built for each pull request to create the sandboxes. Therefore, you need to have a process in place where an image is built for every pull request that is raised.

  2. CI/CD System: You must be using a CI/CD that has the capability to run commands using the Signadot CLI.

Once you have these pre-requisites in place, you can proceed with the integration of Signadot with your CI/CD pipeline.

Set up Sandboxes in your CI/CD pipeline

Creating a Sandbox for a Pull Request

To create a sandbox when a PR is opened, you need to have a sandbox template checked into your repository. This template will be used by the CI system to create a sandbox for each PR. You can find an example of a sandbox template here.

The CI system can fill in the values in the template dynamically based on the service that is calling it. For example, the image that is built for the PR will be used to create the sandbox.

Consider adding a comment in the Pull Request or another appropriate location, providing users with a link to the Signadot Dashboard. This will enable them to monitor logs and check the health status of their sandbox.

Teardown of Sandboxes

Once the PR is closed, the sandbox can be torn down. This can be done using the Signadot CLI. Alternatively, you can set a Time To Live (TTL) for the sandbox. Once the TTL expires, the sandbox will be automatically deleted. You can find more information on setting the TTL in the TTL documentation.

Verifying the Integration

After a run of the CI pipeline, you can verify the sandbox from the Signadot Dashboard. Here are the steps to do so:

  1. Navigate to the Signadot Dashboard.
  2. Click on the "Sandboxes" tab on the left-hand side.
  3. You should see a list of all the sandboxes. Click on the sandbox that you want to verify.
  4. Check the "Status" field. It should be "Ready" if the sandbox is set up correctly and is healthy.
  5. Click on the "Spec" tab to see the specifics of the sandbox. Here, you can verify parameters like TTL and other specifics.

By following these steps, you can ensure that the sandbox is set up correctly and is ready for use.