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 captures 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 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. Refer to 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
-
In the Applications List, select an application, and then select Snapshots.
The Snapshot List displays.
-
To add a new snapshot, select There are no Snapshots. Add one +.
The New Snapshot dialog box displays.
-
Enter the snapshot name and an optional description.
The snapshot name must be unique within the application. You can use this name to indicate the user-defined version of the model. For example, in the figure below, refer to HeatClinic v1.2.
You can use Application snapshots for various purposes, including creating a baseline version of the model or to model a future or desired state of the model.
-
Select Next. The New/Preview dialog box opens.
-
Toggle between the Component and App Process views to view the components and application processes for the selected application.
In the Component view, change the version of the Config component to Latest.
-
Select OK.
A message displays stating that the snapshot has been created, and the snapshot list is updated.
Deploying application snapshots
-
In the Applications List, choose an application, and then select Run process.
-
Select New Run.
The dialog box to select the settings for the application run opens.
-
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.
Selecting the arrow next to Compare shows the comparison of the selected snapshot to last deployment of the Run process in the heatclinic-qe environment.
-
-
To deploy the snapshot, select OK.
Creating environment snapshots
-
Open an environment inventory from the Environments list.
-
Choose an application and select Add snapshot. The New Snapshot dialog box opens.
-
Enter the name and a description of the snapshot. Enter something like
Heatclinic_QE2
. -
Select 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. -
Select 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 then select Compare. 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.
The App Process shows one difference. Heatclinic v1.2 has one less application process than Heatclinic_QE2.
Selecting the drop-down next to the snapshot name allows you to select a different snapshot. |