Guidelines for Modeling and Deploying Applications in CloudBees CD

5 minute read

When Modeling Applications

Keep the following in mind:

  • By default, change tracking is enabled for all CloudBees CD Deploy projects.

  • When authoring a component process, you specify the process type. The default is Deploy.

    In the Component Process dialog box, select one of these values in the Type field: Deploy –Enables Inventory Tracking. The CloudBees CD server tracks the artifacts deployed to environments. Undeploy —The next time that the process is run, the CloudBees CD server removes information about the artifacts deployed to environments. * *Other –Disables Inventory Tracking.

  • You can also create a library of standardized reusable components to promote best practices across the enterprise and speed up application authoring with master components . This is an easy way to reuse existing definitions and their underlying process definitions. Go Master Components for more information.

  • After creating an application, you can version the entire application model by taking a snapshot of it. A snapshot is an immutable version of an application with specific artifact versions.

    You can save more than one snapshot of an application during the software release life cycle. You can compare snapshots to optimize and troubleshoot the application. You can also deploy a snapshot even if the latest version of the application has been modified.

    See Snapshots for more information.

  • You can include hyperlinks as part of an object description for any CloudBees CD object.

  • Known issues:

    • If an application tier has two components that cannot be deployed to the same host, the components need to be in different application tiers.

    • If a formal parameter in a manual process step is renamed, the formal parameter properties are not updated.

  • See Inventory Tracking for more information.

  • Go to Environment Inventory for more information.

  • See Example: Modeling and Deploying Applications for an example of the Application Inventory in the Application View Run page.

When Modeling Environments

You can optimize how resources are used in application deployments. You can model dynamic environments that are automatically spun up when an application is deployed. These environments can have cloud and static resources. Cloud resources are provisioned using resource templates, which are specified in environment templates.

Using dynamic environments allows you to:

  • Provide ways to optimize how cloud resources are used.

  • Reuse provisioned resource pools.

  • Track how provisioned cloud resources are used.

  • Provide the status of the provisioning process.

  • Verify the credentials of cloud resources before provisioning them.

  • Configure the middleware of cloud resources on an on-demand basis.

When Deploying Applications

How an application is deployed depends on what you want to deploy. You can select the following deployment options.

  • New run –Specify the runtime parameters and settings in the dialog box.

  • Last run –Use the parameters from a previous run. You can modify one or more of these parameters as described in the dialog box where the runtime parameters and settings are set.

    The option does not appear the first time an application is deployed.
  • Schedule –Set the application to run on a schedule as described in Running Applications with Schedules .

You can also deploy the application with these options and methods:

  • Full deploy–CloudBees CD deploys all the objects (including application processes, components, and artifacts) in the application. When you deploy an application for the first time, you must do a full deploy. Later, you can use this method to verify that the software is ready to be released.

  • Smart deploy–This deployment method reduces risk and time by only deploying changed objects. CloudBees CD automatically detects the differences between what is about to be deployed and what has already deployed to an environment. It deploys only those objects not yet deployed to a specific resource or to resources where the object version is different. You can use this method throughout the software release life cycle.

  • Partial deploy—The system deploys only objects that you select. You can use this method to verify incremental changes.

  • Partial deploy with specific artifact versions—The system deploys only the artifacts with selected versions. You can use this method to verify incremental changes.

  • Schedule–You can create schedules to deploy applications on a one-time, daily, weekly, or monthly basis. You can schedule nightly builds so that the developers and quality always have a new version to work on every day.

  • Snapshot–You select a snapshot to deploy. A snapshot is an immutable version of the application with specific artifact versions. You can save and compare snapshots throughout a release life cycle.

    If you select a snapshot and modify it, it is no longer a snapshot and becomes a different version of the application, which you can save as a new snapshot.
  • Based on custom parameters defined in application processes–Set these parameters when you deploy the application or when you define an application process step. They determine how the application should be deployed.

  • Artifact staging–CloudBees CD retrieves the artifacts that will be deployed in an application run before the deployment starts. This ensures that all the artifacts are downloaded and available on the target. It also minimizes the time it takes to retrieve artifacts and reduces downtime during the deployment. See Artifact Staging for more information.

  • Rollback–When an application deployment fails, you can use the rollback functionality to restore the deployment model to a previous state before the failure occurred. This operation is supported only in application processes. See Rollback for more information.

You can deploy applications by combining methods, such as:

  • Smart deploy and partial deploy

  • Smart deploy, artifact staging, and a partial deploy with specific artifact versions

  • Full deploy and artifact staging with a snapshot

  • Smart deploy and artifact staging

  • Artifact staging and partial deploy

For example, this sequence is an example of how you may deploy your software over time:

  • When you create an application in CloudBees CD and deploy it for the first time, you must do a full deploy. By default, smart deploy is disabled the first time that you run an application.

  • Throughout these deployments, you can schedule the deployments to occur on a daily or weekly basis to provide builds that can be tested and installed on a regular basis.

  • You can also save snapshots of the software at regular intervals or milestones. When you need to troubleshoot the software or want to do performance testing, you can use one of these snapshots for comparison.

  • If the application does not deploy successfully, you can redeploy parts of it to troubleshoot the application or component processes that failed.

    You can do a partial deploy and redeploy the application with only the objects that failed.

    You can also do a partial deploy only with specific versions of artifacts to determine if one or more specific versions of artifacts are causing problems.

  • Later, after successfully deploying the application, you can redeploy parts of the application when new versions of artifacts or new resources are available.

  • When a new version of an artifact is released, you can deploy only the artifact by selecting the new version and doing a partial deploy.

  • When you add artifacts and resources to the application, you deploy the new artifacts to resources and specific versions of selected artifacts to the new resources, a combination of smart deploy and partial deploy with specific artifact versions.

Getting the Real-Time Status of Application Runs and Troubleshooting

Use the Environment Inventory and Application Inventory to view the progress of the application as it runs and the results of previous runs. They show detailed results that can be used to troubleshoot the application. See Inventory Tracking for more information.

  • In the Application Inventory (on the Applications Run View page), you can get information about the application, its application processes, components, and job steps and about the status of these objects.

  • In the Environment Inventory, you can get more details about the environment, the applications mapped to it, number of deployed artifacts in the applications, where the artifacts are deployed, and the status of these objects.

Use Change Tracking to troubleshoot a failed job, look for more information about non-run object, or look for differences between objects. See Change Tracking for more information.

Compare snapshots to refine and troubleshoot an application. See Snapshots for more information.