Skip to content

Commit

Permalink
Merge pull request #2282 from strapi/cloud/cli/link-environment
Browse files Browse the repository at this point in the history
Add `strapi cloud environment link` to Cloud CLI
  • Loading branch information
gonbaum authored Nov 21, 2024
2 parents 2cb41ec + 4d00e22 commit 2f33bb3
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions docusaurus/docs/cloud/cli/cloud-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,20 @@ Deploy a new local project (< 100MB) in Strapi Cloud.
strapi deploy
```

This command must be used after the `login` one. It deploys a local Strapi project on Strapi Cloud, without having to host it on a remote git repository beforehand. The terminal will inform you when the project is successfully deployed on Strapi Cloud.
This command must be used after the `login` one. It deploys a local Strapi project on Strapi Cloud, without having to host it on a remote git repository beforehand.

Once the project is first deployed on Strapi Cloud with the CLI, the `deploy` command can be reused to trigger a new deployment of the same project.

:::caution
The `deploy` command can only be used by new users who have never created a Strapi Cloud project, and for which the free trial is still available. Once a project is deployed with the CLI, it isn't possible to deploy another project on the same Strapi Cloud account with the CLI.
:::note
If you have any free trial available, the deploy command will create automatically a new project on Strapi Cloud, unless you previously link your local project to an existing project by using the `strapi link` command.
:::

When you use this command, you’ll be asked to select a target environment. To skip this prompt, you can either:
- Use the `--env` flag (e.g., `strapi deploy --env <environment-name>`)
- Set a default environment with `strapi cloud environment link` [command](#cloud-environment-link), so deployments automatically go to that environment.

The terminal will inform you when the project is successfully deployed on Strapi Cloud.

Once the project is first deployed on Strapi Cloud with the CLI, the `deploy` command can be reused to trigger a new deployment of the same project.

:::note
Once you deployed your project, if you visit the Strapi Cloud dashboard, you may see some limitations as well as impacts due to creating a Strapi Cloud project that is not in a remote repository and which was deployed with the CLI.

Expand All @@ -62,6 +68,10 @@ Once you deployed your project, if you visit the Strapi Cloud dashboard, you may

Links project in current folder to an existing project in Strapi Cloud.

:::note
Linking a project to Strapi Cloud doesn't limit it to Strapi Cloud alone; you can still deploy and manage it in your own self-hosted environment as needed.
:::

```bash
strapi link
```
Expand Down Expand Up @@ -97,6 +107,16 @@ strapi cloud environments

This command retrieves and displays a list of all environments belonging to your Strapi Cloud project.

## strapi cloud environment link <NewBadge /> {#cloud-environment-link}

Links your local project to a specific environment in your Strapi Cloud project.

```bash
strapi cloud environment link
```

This command shows a list of all environments in your Strapi Cloud project and lets you choose one. The selected environment will then be the default for direct deployments.

## strapi logout

**Alias:** `strapi cloud:logout`
Expand Down

0 comments on commit 2f33bb3

Please sign in to comment.