Environments

3 minute read

The CloudBees platform allows for creation of environments that are useful when building and deploying software. An environment is the target infrastructure where component artifacts are deployed, enabling application user interaction.

Workflow jobs can target a specific environment using the environment keyword. Environment bindings are useful in enhancing the behavior of a job with approval flows, or adding an environment-specific secret property for 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.

Access an environment

To access an environment:

  1. Select Up/down arrows, and then select an organization, sub-organization, or component.

  2. Select Configurations  Environments. The Environments list displays environments in the selected organization or component.

    Environments
    Figure 1. Environments
  1. Use these features to:

  2. Review the Name, Source, Approval, Description and Flags overview information.

Create an environment

Create any number of environments.

To create an environment:

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

  2. Select Create environment.

  3. Enter an Environment name.

  4. Configure applicable fields.

    • Enter a Description.

    • Select Approvers if you want to require a manual approval before deployment.

    • Select Add key/value to enter any Properties and secrets you want associated with the environment. For more information, refer to properties configuration and properties in an environment.

  5. Select Submit.

    Create environment
    Figure 2. Create environment

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 to update.

  3. Select Edit environment.

  4. Make desired changes.

  5. Select Save. The environment is updated.

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

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

  3. Select Delete environment.

  4. Select Delete.

Approvals in an environment

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

Approval required
Figure 3. Approval required example

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 perform manual approvals.

View artifacts deployed in an environment

Use the Inventory features to access information and functions related to artifacts deployed in an environment.

To collect artifact data, a workflow must contain either the Register a build artifact or Register an artifact deployed to an environment action.

To review artifacts deployed in an environment:

  1. Select Up/down arrows, and then select an organization, sub-organization, or component.

  2. Select Configurations  Environments. The Environments list displays environments in the selected organization or component.

  3. Select Vertical ellipsis next to an environment and then View environment. The Inventory displays a list of artifacts built or deployed in the environment.

    Inventory
    Figure 4. Environment
  1. Manage artifacts list.

    • Filter deployments by Name.

    • Locate a specific artifact using the Search feature.

  2. Review the Artifact, Version, Digest, Component name, Deployment Run, Deployment date and Published by information.

  3. Use these features to:

    • Copy the path to a specific artifact digest by selecting the Copy.

    • Access the deployment workflow run details by workflow run name in the Deployment run column.

    • Access the build workflow run details by workflow run name in the Published by column.