Environments are used to aggregate project resources, such as repositories, to simplify their management.
Artifactory contains two default environments - DEV (Development) and PROD (Production), and additional custom environments can be created for specific projects, or for all projects, as needed. Each repository can be assigned to one or more environments, a feature that enables you to allocate repositories in ways that best serve the needs of your organization. Multiple repositories can be assigned to the same environment.
You can create custom environments at the global level, where they are available for users of all projects, or at the project level for the members of that project. At the project level, specific roles can be assigned to custom environments, which enable you to implement a more granular permissions model for that project.
Environment Management Workflow
The following workflow shows how you can create and manage environments.
# | Procedure | Using Platform UI | Using APIs |
---|---|---|---|
1 | Create a global environment | POST ${baseUrl}/v1/environments | |
2 | Create a project environment | POST ${baseUrl}/v1/projects/{project_key}/environments | |
3 | Edit a global role and assign an environment | PUT ${baseUrl}/v1/roles/{role} | |
3 | Create a custom global role and assign an environment | POST ${baseUrl}/v1/roles | |
4 | Create a project role and assign an environment | POST ${baseUrl}/v1/projects/{project_key}/roles | |
5 | Assign repositories to each environment | Update Repository Configuration Based on changes made in the Repository Configuration JSON. | |
6 | Delete a custom environment | DELETE ${baseUrl}/v1/environments/{environment_name} |