Capturing snapshots

5 minute readReferenceAutomation

In a software release process, the goal is to have a consistent deployment process that can be run often throughout the release life cycle. When the deployments are run in production, there are no unexpected results. Snapshots are used to implement these deployments.

A snapshot captures both the component versions and the process that were used for deployments. These snapshots make the deployments repeatable and stable.

CloudBees CD/RO supports these types of snapshots:

  • Environment snapshot—An environment snapshot is created from an environment where the application is deployed and tested. A snapshot will capture the exact artifact versions, process versions, configuration parameters, and so on used for the deployment to ensure repeatability. This is considered the reliable version of a snapshot for reliability and repeatability.

  • Application snapshot—A snapshot is created directly from the application model and does not depend on any environment deployment. When a snapshot is captured from the application model, it locks the architecture, components, and process versions. If you specify the “Latest” artifact version as part of the component definition in the snapshot, the latest artifact versions will be used every time it is used for deployment. The main purpose of an application-based snapshot is to allow the creation of user-defined versions of the models. The application snapshot name can be used to indicate a specific user-defined version.

For example, in a software delivery process, the developer checks in code, the components are built automatically by a continuous integration system, and the objects in the resulting build are published to a binary artifact management system. When the full complement of component artifacts is available, a release candidate pipeline is initiated. The first stage is to deploy to a development environment. From this deployment, a snapshot is created and used as the model for subsequent deployments to other environments.

There will be some differences between the development, QA and production environments, such as database connection strings, credentials, and debug-vs-production artifacts. CloudBees CD/RO can manage these differences in the application using parameters and properties in templates, only modifying the deployment process flow in a controlled manner.

The process described in the example avoids some of the pitfalls encountered in traditional release scenarios. For example, configuration teams often perform their own builds. This means that the binaries supplied by the CM team may be different than what has already been tested. Release teams may also manually edit configuration files to adjust for differences in the deployment environments. Both of these practices are prone to error and can negatively impact the quality of the final software release.

In CloudBees CD/RO, you can deploy snapshots for more reliable and repeatable software releases. Here are some of the use cases snapshots can serve:

  • You can model and save a version of your software release with specific artifact versions and rerun it later, even if the latest release version of it has changed.

  • If you save snapshots during development and test phases, you can ensure that the components that were deployed and tested are the same as those in the release candidate. You can redeploy the snapshot any time.

  • You can create and save more than one snapshot for different deployment scenarios.

  • You can use an application snapshot to capture a version of the model. This can be used to define a future or desired state of the application model as well.

  • You can view the snapshots in the Snapshot List. From this list, you can manage all your snapshots, compare two snapshots, or get more information about them.

  • Comparing snapshots helps you to deploy releases with reliable and repeatable results during ongoing software release cycles. You can build and test releases using snapshots and do not have to design new applications for each release. Comparing snapshots also allows you to compare a future or desired state of the application model to any saved version of the model. See Comparing Snapshots and Comparing Results for more information.

  • You can use snapshots to refine and optimize applications that fit your deployment scenario and ensure that this version is properly developed, tested, and released.

Example: Creating, deploying, and comparing snapshots

This example shows how to create application and environment snapshots, deploy snapshots, and compare them during the software release life cycle.

Creating application snapshots

  1. In the Applications List, choose an application and click the snapshot button.

  2. Select Snapshot List.

    The Snapshot List appears.

  3. To add a new snapshot, click There are no Snapshots. Add one +.

    The New Snapshot dialog box appears.

  4. Enter the name for the snapshot that must be unique within the application and enter an optional description of it.

    This name can be used to indicate the user defined version of the model. For example, in the figure below, see HeatClinic v1.2 .

    Application snapshots can be used for various purposes like creating a baseline version of the model or even for modeling a future state or desired state of the model.

  5. Click Next. The New/Preview dialog box opens.

  6. Toggle between the Component and App Process views to see the components and application processes for the selected application.

    In the Component view, change the version of the Config component to Latest.

  7. Click OK.

    A message appears stating that the snapshot has been created, and the snapshot list is updated.

Deploying application snapshots

  1. In the Applications List, choose an application and click the Run process button.

  2. Select New Run.

    The dialog box to select the settings for the application run opens.

  3. Select these settings for the application run:

    • In the Select Process field, select Run.

    • In the Select Environment field, select heatclinic-qe.

    • In the Select a Snapshot field, select HeatClinic v1.2.

      Clicking arrow next to Compare shows the comparison of the selected snapshot to last deployment of the Run process in the heatclinic-qe environment.
  4. To deploy the snapshot, click OK.

Creating environment snapshots

  1. Open an environment inventory from the Environments list.

    snaps compare task1a
  2. Choose an application and select New Snapshot. The New Snapshot dialog box opens.

  3. Enter the name and a description of the snapshot. Enter something like Heatclinic_QE2.

  4. Click Next. The New/Preview dialog box opens. You can view the snapshot settings in the Component and App Process tabs but cannot change them because the application has been deployed to the heatclinic-qe environment.

  5. Click OK.

Comparing snapshots

This example shows how to compare an application snapshot to an environment snapshot.

In the Snapshot list, select two snapshots that you want to compare and click the Compare button. The Snapshot Comparison page opens.

Comparing results

In the Snapshot Comparison page, the Component and App Process views show the differences between the snapshots, Heatclinic v1.2 (the application snapshot) and Heatclinic_QE2 (the environment snapshot). Heatclinic_QE2 is the more reliable, repeatable, and up-to-date version of the application.

The Component view shows that the Config component is different. Heatclinic v1.2 uses the Latest version of the artifact that may not be the same as the artifact version in Heatclinic_QE2, the more reliable and repeatable version of the snapshots.

snaps compare task result1

The App Process shows one difference. Heatclinic v1.2 has one less application process than Heatclinic_QE2.

snaps compare task1c
Clicking the drop-down next to the snapshot name allows you to select a different snapshot.