Copado‎ > ‎

Environments

Environment records are created automatically when Org credentials are authenticated. The Organization ID will be the external ID. This way an Environment may have multiple Org credentials, different users, to the same Organization (aka enviroment)

By default the environment name will get the Org credential name upon creation, but it can be updated afterwards.

Change the default minimal code coverage, it will enforced on the User Stories as part of the Copado Change Management module.

Enforce all local apex test execution across the entire Copado application whenever a deployment is done to the environment regardless of the Org credential used or the user selection on the deployment record. This can be used to replicate the same behaviour on sandboxes as in Production

Environment Variables

Environment Variables allow users to make Commits, Deployments, Branch Validation and Selenium Test Cases environment agnostic.

To create an Environment Variable, just press the "New Environment Variable" button on the Environment Variables related list. Choose a Name, for example: ‘URL’ and set a value, such as ‘http://test.mysite.com'.

Note: Environment Variables should be unique on names and values. I.e. there cannot be Variables with the same value. This is to guarantee a proper replacement process in all scenarios, whether replacements are Value to Key or Key to Value.

Commits

When performing a Git Commit, Copado will search the metadata files for any matching Environment Variable Values and replace them with the corresponding Key.

E.g. Environment Variable: AdminUser = admin.user.test@company.com
In the Metadata files, any occurrences of ‘admin.user.test@company.com’ would be replaced with {!Environment.AdminUser}
This then allows Copado to replace another Environment’s Variables into the metadata during a deploy.

Git Deployments

When performing a deployment from Git, Copado will search the metadata files for any matching environment variable keys and replace with the corresponding value.

E.g. Environment Variable: AdminUser = admin.user.uat@company.com
In the Metadata files, any occurrences of {!Environment.AdminUser} would be replaced with admin.user.uat@company.com.

Org to Org Deployments

When performing an Org to Org Deployment, Copado will replace all maps from the source Environment’s Variables to the destination environment’s.

E.g. Source Environment Variable: AdminUser = admin.user.test@company.com
Destination Environment Variable: AdminUser = admin.user.uat@company.com
In the Metadata files, Copado will replace any occurrences of ‘admin.user.test@company.com’ with ‘admin.user.uat@company.com’

Branch Management - Validation / Deployment

When running Branch Validation, Copado will validate that a branch is mergeable and deployable. As part of this, Copado will replace Environment Variables in the metadata files just like during a Git Deployment.

Selenium

Use environment variables on your Test Cases so that they get replaced with different values when running on different environments.

On your Test Case refer to an Environment Variables, by the Key: {!Environment.Name}. E.g. {!Environment.URL}


Manage Environmental Variables

As from Copado v7, with this feature you will be able to overview all Environmental Variables in a Deployment Flow in one single grid, boosting your productivity when editing values, creating new variables...

Environmental Variables included in Environments that are part of your flow as Destination Orgs in Continuous Integrations, are included too.


How to use it:

In your Deployment Flow, you will find a new button that will take you to this new Visualforce page.

Once opened, you will find useful information about the usage of Environmental Variables, and variables will be displayed in a grid, grouped by name (rows) and a column per value in a Environment (Environment name will be in the column header).

Please, consider the following when using this feature:

  •  Once loaded, the grid creates empty-valued variables for Environments in which a variable with the same name is missing but available in another Environment (population of the grid for missing variables).
  •  You can remove a variable from the grid. This will result in deleting the variable in all Environments.
  •  You can add a new variable to the grid. This will result in creating the variable in all Environments with an empty value.
  •  You can mass-edit the grid, once saved, all records will be updated. Renaming of the name of variables is fully supported.
  •  Headers in golden background are Environments in your Deployment Flow. Headers in light-grey background are Continuous Integrations in your Deployment Flow.

Comments