|
1
|
import { Note, getOsShortcut, Kbd } from "docs-ui" |
|
2
|
|
|
3
|
export const metadata = { |
|
4
|
title: `Environments`, |
|
5
|
} |
|
6
|
|
|
7
|
# {metadata.title} |
|
8
|
|
|
9
|
In this guide, you'll learn about environments in Cloud, how to create and manage them, and how to use preview environments. |
|
10
|
|
|
11
|
## Environments Overview |
|
12
|
|
|
13
|
A Cloud project can have multiple environments, each representing a different stage of your application. For example, you can have a Production environment for your live application, and a Staging environment for testing new features. |
|
14
|
|
|
15
|
Each environment has its own deployed Medusa backend, admin dashboard, and storefront. It also has its own resources, such as a database and server instance. |
|
16
|
|
|
17
|
By default, a project has at least a Production environment, and you can create custom environments based on your development needs. |
|
18
|
|
|
19
|
Environments are useful to test changes in production-like conditions before actually pushing them to production. You can test out new features, bug fixes, and integrations without affecting the live application. |
|
20
|
|
|
21
|
### Environment Types |
|
22
|
|
|
23
|
There are two types of environments: |
|
24
|
|
|
25
|
- [Long-lived environments](./long-lived/page.mdx): These are environments that you create for specific branches in your GitHub repository, such as Production or Staging environments. |
|
26
|
- [Short-lived Preview environments](./preview/page.mdx): These are environments automatically created for each pull request (PR) towards a branch that has an environment in Cloud. They're created as a preview for the PR, and are destroyed once the PR is merged or closed. |
|
27
|
|
|
28
|
--- |
|
29
|
|
|
30
|
## View Project's Environments on Cloud |
|
31
|
|
|
32
|
To view a project's environments: |
|
33
|
|
|
34
|
<Note title="Tip"> |
|
35
|
|
|
36
|
You can also navigate to an environment's overview page from the [command palette](../command-palette/page.mdx). Press <Kbd>{getOsShortcut()}</Kbd> + <Kbd>K</Kbd>, select **Project Overview**, then choose a project. |
|
37
|
|
|
38
|
</Note> |
|
39
|
|
|
40
|
1. If you're in a different organization, [switch to the organization](../organizations/page.mdx#switch-organization) whose settings you want to view. |
|
41
|
2. Click **Projects** in the sidebar and select the project you want to view. |
|
42
|
|
|
43
|
In the project's dashboard, you'll find a card for every long-lived environment in your project. Production environments are displayed first, followed by other environments. For example, you may have Production and Staging cards. |
|
44
|
|
|
45
|
You'll also find a table listing all the preview environments created for the project below the long-lived environment cards. |