Skip to content

Commit

Permalink
Update to Cloud CLI docs re. connecting a git repo. (#2128)
Browse files Browse the repository at this point in the history
* Update to Cloud CLI docs re. connecting a git repo.

* Add mention for all deploy. methods

* Fix heading link

* Update deploys intro.
  • Loading branch information
pwizla authored Jun 26, 2024
1 parent de9d2c3 commit bf18bd3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 32 deletions.
5 changes: 1 addition & 4 deletions docusaurus/docs/cloud/cli/cloud-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ sidebar_position: 3

Strapi Cloud comes with a Command Line Interface (CLI) which allows you to log in and out, and to deploy a local project without it having to be hosted on a remote git repository. The CLI works with both the `yarn` and `npm` package managers.

The Cloud CLI is designed as a CLI-only experience, meaning that users who wish to use Strapi Cloud to deploy their project with the CLI will have to mostly stick to using the CLI (e.g. if you login with the CLI you must logout with the CLI as well, your project deployed with the CLI can only be redeployed with the CLI etc.).

:::note
It is recommended to install Strapi locally only, which requires prefixing all of the following `strapi` commands with the package manager used for the project setup (e.g `npm run strapi help` or `yarn strapi help`) or a dedicated node package executor (e.g. `npx strapi help`).
:::
Expand Down Expand Up @@ -50,8 +48,7 @@ The `deploy` command can only be used by new users who have never created a Stra
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.

- Some areas in the dashboard that are usually reserved to display information about the git provider will be blank.
- Some buttons, such as the **Trigger deploy** button, will be greyed out and unclickable since you can only redeploy your project using the CLI.
- Options such as environment variables, and features like the logs, are not available for CLI-created projects. <!-- to be confirmed -->
- Some buttons, such as the **Trigger deploy** button, will be greyed out and unclickable since, unless you have [connected a git repository to your Strapi Cloud project](/cloud/getting-started/deployment-cli#automatically-deploying-subsequent-changes).
:::

## strapi logout
Expand Down
64 changes: 39 additions & 25 deletions docusaurus/docs/cloud/getting-started/deployment-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ Before you can deploy your Strapi application on Strapi Cloud using the Command

3. Enter the following command to log into Strapi Cloud:

<Tabs groupId="yarn-npm">
<TabItem value="yarn" label="Yarn">
<Tabs groupId="yarn-npm">
<TabItem value="yarn" label="Yarn">

```bash
yarn strapi login
```
```bash
yarn strapi login
```

</TabItem>
<TabItem value="npm" label="NPM">
</TabItem>
<TabItem value="npm" label="NPM">

```bash
npx run strapi login
```
```bash
npx run strapi login
```

</TabItem>
</Tabs>
</TabItem>
</Tabs>

4. In the browser window that opens automatically, confirm that the code displayed is the same as the one written in the terminal message.

Expand All @@ -52,29 +52,43 @@ npx run strapi login

1. From your terminal, still from the folder of your Strapi project, enter the following command to deploy the project:

<Tabs groupId="yarn-npm">
<TabItem value="yarn" label="Yarn">
<Tabs groupId="yarn-npm">
<TabItem value="yarn" label="Yarn">

```bash
yarn strapi deploy
```
```bash
yarn strapi deploy
```

</TabItem>
<TabItem value="npm" label="NPM">
</TabItem>
<TabItem value="npm" label="NPM">

```bash
npx run strapi deploy
```
```bash
npx run strapi deploy
```

</TabItem>
</Tabs>
</TabItem>
</Tabs>

2. Follow the progression bar in the terminal until confirmation that the project was successfully deployed with Strapi Cloud.

### Automatically deploying subsequent changes

By default, when creating and deploying a project with the Cloud CLI, you need to manually deploy again all subsequent changes by running the corresponding `deploy` command everytime you make a change.

Another option is to enable automatic deployment through a git repository. To do so:

1. Host your code on a git repository, such as [GitHub](https://www.github.com) or [GitLab](https://www.gitlab.com).
2. Connect your Strapi Cloud project to the repository (see the _Connected repository_ setting in [Projects Settings > General](/cloud/projects/settings#general)).
3. Still in _Projects Settings > General_ tab, tick the box for the "Deploy the project on every commit pushed to this branch" setting. From now on, a new deployment to Strapi Cloud will be triggered any time a commit is pushed to the connected git repository.

:::note
Automatic deployment is compatible with all other deployment methods, so once a git repository is connected, you can trigger a new deployment to Strapi Cloud [from the Cloud dashboard](/cloud/projects/deploys), [from the CLI](/cloud/cli/cloud-cli#strapi-deploy), or by pushing new commits to your connected repository.
:::

## ⏩ What to do next?

Now that you have deployed your project via the Command Line Interface, we encourage you to explore the following ideas to have an even more complete Strapi Cloud experience:

- Fill in your [billing information](/cloud/account/account-billing) to prevent your project from being suspended at the end of the trial period.
- Visit the Cloud dashboard to follow [insightful metrics and information](/cloud/projects/overview) on your Strapi project.
- Check out the full [Command Line Interface documentation](/cloud/cli/cloud-cli) to learn about the other commands available.
- Check out the full [Command Line Interface documentation](/cloud/cli/cloud-cli) to learn about the other commands available.
4 changes: 2 additions & 2 deletions docusaurus/docs/cloud/projects/deploys.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ sidebar_position: 1

The creation of a new Strapi Cloud project automatically trigger the deployment of that project. After that, deployments can be:

- automatically triggered everytime a new commit is pushed to the branch (see [Project settings](/cloud/projects/settings#modifying-git-repository-branch)),
- or [manually triggered](#triggering-a-new-deployment) whenever needed.
- manually triggered whenever needed, [from the Cloud dashboard](#triggering-a-new-deployment) or [from the CLI](/cloud/cli/cloud-cli#strapi-deploy),
- or automatically triggered everytime a new commit is pushed to the branch, if the Strapi Cloud project is connected to a git repository and the "deploy on push" option is enabled (see [Project settings](/cloud/projects/settings#modifying-git-repository--branch)).

Ongoing deployments can also be [manually cancelled](#cancelling-a-deployment) if needed.

Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/cloud/projects/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ There are 7 tabs available:
The ![General icon](/img/assets/icons/Faders.svg) *General* tab enables you to check and update the following options for the project:

- *Details*: to see the name of your Strapi Cloud project, used to identify the project on the Cloud Dashboard, Strapi CLI, and deployment URLs. The project name is set at project creation (see [Project creation](/cloud/getting-started/deployment)) and cannot be modified afterwards.
- *Connected Git repository*: to change the branch of the GitHub repository used for your project (see [Modifying GitHub repository branch](#modifying-git-repository-branch)). Also allows to enable/disable the "deploy on push" option.
- *Connected Git repository*: to change the branch of the GitHub repository used for your project (see [Modifying GitHub repository branch](#modifying-git-repository--branch)). Also allows to enable/disable the "deploy on push" option.
- *Selected region*: to see the hosting region of the project, meaning the geographical location of the servers where the project and its data and resources are stored. The hosting region is set at project creation (see [Project creation](/cloud/getting-started/deployment)) and cannot be modified afterwards.
- *Debug info*: to see the internal project name for the project. This is useful for support purposes.
- *Node version*: to change the Node version of the project (see [Modifying Node version](#modifying-node-version)).
Expand Down

0 comments on commit bf18bd3

Please sign in to comment.