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 artifacts, enabling user interaction with the application.

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

Access an environment

View a list of environments for your organization, including their source and approval status. Search in and sort the environment list to select information for a specific environment.

To access environments:

  1. Select an organization, and then select Configurations  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.

Environment listing
Figure 1. Environment listing for an organization.

As in the above example, the environment list includes the following:

  1. The source of the environment, either Original or Inherited.

  2. If approval is required, the environment is marked Approval required.

  3. Select Vertical ellipsis to:

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.

When that job attempts to run, an icon is displayed indicating that the job is waiting for approval. Open the run details 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 manually approve the job.

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 objects used by expressions in jobs. These environmental properties and secrets take precedence over, or 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.

View inventory

If you deploy software to a live environment, it must be associated with a named environment. The Inventory lists deployment information associated with an environment.

To access the inventory:

  1. Select an organization, and then select Configurations  Environments.

  2. Select Vertical ellipsis next to an environment, and then select View inventory.

  3. (Optional) Filter the inventory by the associated:

    • Artifact

    • Application

    • Component

  4. (Optional) Search for a specific artifact by entering all or part of an artifact name into Search.

Environment details
Figure 2. 'test', an example deployment environment.

As in the example above, the inventory includes:

  1. The list of associated artifacts and their versions.

  2. Select Copy to copy the digest SHA, if applicable.

  3. Select the name of the deployment run to view the run details.

  4. Select the name of the workflow run that published the artifact to view the run details.

Create an environment

Create any number of environments for feature management or deployment.

To create an environment:

  1. Select an organization, and then select Configurations  Environments.

  2. Select Create environment.

  3. Enter an Environment name.

  4. (Optional) Enter a Description.

  5. (Optional) Select Approvers if you want to require a manual approval 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 in an environment and property configuration.

  7. Select Submit.

    Create environment
    Figure 3. 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 an organization, and then select Configurations  Environments.

  2. Select Vertical ellipsis 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. All properties and secrets specified during the environment creation are also deleted.

To delete an environment:

  1. Select an organization, and then select Configurations  Environments.

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

  3. Select Delete environment.

  4. Select Delete.

The selected environment, including any associated properties and/or secrets, is deleted and removed from the environment list.