Lock environments

2 minute readReferenceAutomation

CloudBees CD/RO allows simultaneous application and microservice deployments to the same environment. These deployments can be for the same or different applications or microservices. This can lead to deployment failures when deployment steps are working on the same resources, for example modifying the same files or starting and stopping the same application server.

Environment locking for exclusive access restricts simultaneous deployments configured for the same environment. It allows application or microservice to exclusively lock an environment for a deployment. When an environment is locked, all other deployments that are started after the lock is acquired are queued.

Exclusive environment access is configured on application processes, top-level microservices, or both at object create/edit time. For more information, refer to Authoring application processes. At runtime, CloudBees CD/RO checks environment availability.

If there is an ongoing reservation or active blackout period on the environment, CloudBees CD/RO inserts Waiting for Environment Reservation as the first step in the deployment job. Once the reservation or blackout ends and the process requires exclusive access but the environment is not available, the Waiting for Environment Reservation step is renamed Waiting for Environment Availability.

Otherwise, CloudBees CD/RO inserts Checking Environment Availability as the first step in the deployment job. If the process requires exclusive access but the environment is not available, this step is renamed Waiting for Environment Availability. When using rolling deploy, Checking Environment Availability is only inserted once, regardless of the number of phases or batches.

Checking environment availability
Waiting for environment availability

Determining blocking processes

You can determine the jobs on which a waiting process is pending.

To view the jobs:

  1. Select Waiting for Environment Availability. The Job Details page opens.

  2. Select the Properties tab.

    The ec_waitingForJobs property lists the blocking jobs.

Environment indicators

The environment editor includes visual indicators to quickly assess the status of your environment and rolling deploy at a glance.

Environment editor indicators
Figure 1. Environment indicators
  1. Rolling deploy toggle: This indicator is green once the rolling deploy phases or batch sizes are configured via the right-hand menu Three lines menu. If these configurations are removed it switches to red. Refer to Example: Implement deployment strategies for more information about rolling deploy.

  2. Available/unavailable toggle: This indicator is green once the environment is configured. If it is switched to the Off position the button turns red and nothing can be deployed to this environment.