Environments

3 minute read

The CloudBees platform allows you to create environments that are useful when building and deploying software. An environment is the target infrastructure where you deploy your component artifact, enabling your application users to interact with it.

Your workflow jobs can reference environment targets that represent environments, by using the environment keyword. Environment bindings enhance the behavior of a job with approval flows, or add environment-specific property/secrets that can be used by job executions.

Properties in an environment

If you specify properties or secrets when you create or update an environment, these are attached to the standard vars (for properties) or secrets (for secrets) context used by expressions in jobs. These environmental properties and secrets take precedence over (override) properties or secrets inherited from the component or organization.

Use environment-specific properties and secrets to parameterize values in your deployment jobs. These properties and secrets interact with selected deployment targets using different URLs and credentials.

For example, you can assign a set of deployment credentials, hostnames, and configuration flags to a production environment different from those for a development environment. Since environment-specific properties and secrets take precedence, you can use the same deployment action for both environments, and have the action inputs vary according to the environment.

Approvals in an environment

Select Approvers when you create or update an environment, to indicate that an approval is required before a job referencing that environment can run.

Approval required
Figure 1. Approval required highlighted in environment list.

When that job attempts to run, an icon is displayed indicating that the job is waiting for approval. Open the run detail for the job, then select APPROVED. With this approval, the job runs.

You must have the Admin role for the component containing the workflow job in order to perform manual approvals for the job.

Access an environment

Search in and sort the environment list.

To access an environment:

  1. Select the next to Configurations on the left pane, and then select Environments.

  2. (Optional) Search for a specific environment, by entering all or part of an environment name into Search.

  3. (Optional) Select an option in Sort by to sort the environment list by either ASCENDING or DESCENDING alphanumerical sort order.

The environments are displayed according to your search or sort criteria.

Create an environment

Create any number of environments.

To create an environment:

  1. Select the next to Configurations on the left pane, and then select Environments.

  2. Select CREATE ENVIRONMENT.

  3. Enter an Environment name.

  4. (Optional) Enter a Description.

  5. (Optional) Select Approvers if you want to have a manual approval required before deployment.

  6. (Optional) Select ADD KEY/VALUE to enter any Properties and secrets you want to associate with the environment. For more information, refer to properties configuration and properties in an environment.

  7. Select SUBMIT.

    Create environment
    Figure 2. Environment created with a manual approval and a secret.

Your environment is created, and listed in Environments.

Update an environment

Update any of the configuration settings of an environment.

To update an environment:

  1. Select the next to Configurations on the left pane, and then select Environments.

  2. Select the next to the environment you want to update.

  3. Select Edit environment.

  4. Make any desired changes.

  5. Select SAVE.

The selected environment is updated accordingly.

Delete an environment

Delete any of your environments. A deleted environment is completely removed from the CloudBees platform, and deletion is irreversible.

To delete an environment:

  1. Select the next to Configurations on the left pane, and then select Environments.

  2. Select the next to the environment you want to delete.

  3. Select Delete environment.

  4. Select DELETE.

The selected environment is deleted and removed from the environment list.