Skip to content

Preview Environments

When developing and testing new features, software teams need environments that accurately reflect production and contain a changeset for a single feature. Producing these environments is difficult, very time-consuming and is often skipped. Teams resort to setting up a single staging environment and merge all the current features into one environment. This becomes hard to maintain and even more difficult to understand when changes conflict with each other. What do you do if new features require infrastructure changes as well?

Nullstone's preview environments solve this by creating a clone of your production environment including all the services, databases, and additional infrastructure needed to run your application. Each environment can have its own configuration and updated infrastructure to allow for experimentation and rapid change. Each preview environment is standalone, providing an isolated environment to test and review your changes with confidence. Load seed or scrubbed data to provide a fresh predictable instance every time.

With preview environments you will be able to:

  • Preview new functionality in a live environment as you review code changes for a PR
  • Provide shareable links to stakeholders in order to collaborate and show off new upcoming features
  • Run tests against a high fidelity environment; providing more predictable results as you merge into production
  • Easily launch environments with select datasets for sales reps to use in sales calls and demos

Workflow

Preview environments can be configured to launch a few different ways:

Automatic Launch

If all your applications are in a single repo, you can configure a preview environment to launch any time a PR (pull request) is created in your source control system. When a PR is opened or re-opened, a preview environment will be automatically launched. When a PR is closed, the associated preview environment is destroyed.

As your preview environment is being launched, comments will be automatically posted to keep you up to date on the progress.

Github PR Comments

Automatic Launch with Multiple Repos

When your system is made up of multiple apps with multiple repos, you will need to perform one additional step to launch a preview environment. In the example below, I have two applications named acme-api and acme-storefront. The source code for each are in separate repos.

Preview Environments - Multiple Apps

When a PR is opened, a comment will be added to the PR that contains a link.

Preview Environments - PR Comment

Click on the link to finish configuring and launching the preview environment. From this screen, you can decide which applications to launch as well as which PR or branch to launch for each. If you open PRs across multiple repos for a feature, this will allow you to launch them all together as one preview environment.

Preview Environments - Configure

In the example above, I have selected to launch both the acme-api and acme-storefront apps. I only have 1 PR for this feature, so it has been selected for the acme-api app. For the acme-storefront app, I have selected to launch the master branch.

TIP

Now that you have configured the preview environment for this PR, Nullstone remembers the configuration, and it will not need to be set up again. Re-opening the PR will automatically launch the preview environment.

Once all PRs associated with this preview environment are closed, the preview environment will be automatically destroyed.

Manual Launch

You can also choose to manually launch preview environments as needed. When configuring preview environments, simply disable the auto-launch feature.

When a PR is opened, a comment will be added to the PR that contains a link.

Preview Environments - PR Comment

From this screen, you can decide which applications to launch as well as which PR or branch to launch for each. If you open PRs across multiple repos for a feature, this will allow you to launch them all together as one preview environment.

Create and Launch via UI

Preview environments can also be created and launched at any time even without a pull request. From the Environments page in your stack, there is a button to Add Preview.

Automatic Updates

If auto-deploy is enabled, the latest code for each application is built and deployed automatically to keep the environment up to date. Any infrastructure changes in your IaC files will be automatically applied as well.

To learn more about the options and syntax for IaC files, check out the Infrastructure as Code guide.

TIP

GitHub is the only source control provider supported at this time.