From bf18bd36a4dc2e7c92f6667295712ec5b4d127a2 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Wed, 26 Jun 2024 11:09:51 +0200 Subject: [PATCH] Update to Cloud CLI docs re. connecting a git repo. (#2128) * Update to Cloud CLI docs re. connecting a git repo. * Add mention for all deploy. methods * Fix heading link * Update deploys intro. --- docusaurus/docs/cloud/cli/cloud-cli.md | 5 +- .../cloud/getting-started/deployment-cli.md | 64 +++++++++++-------- docusaurus/docs/cloud/projects/deploys.md | 4 +- docusaurus/docs/cloud/projects/settings.md | 2 +- 4 files changed, 43 insertions(+), 32 deletions(-) diff --git a/docusaurus/docs/cloud/cli/cloud-cli.md b/docusaurus/docs/cloud/cli/cloud-cli.md index b31fc03869..6df9553361 100644 --- a/docusaurus/docs/cloud/cli/cloud-cli.md +++ b/docusaurus/docs/cloud/cli/cloud-cli.md @@ -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`). ::: @@ -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. +- 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 diff --git a/docusaurus/docs/cloud/getting-started/deployment-cli.md b/docusaurus/docs/cloud/getting-started/deployment-cli.md index b793f1003a..49c5efe6a9 100644 --- a/docusaurus/docs/cloud/getting-started/deployment-cli.md +++ b/docusaurus/docs/cloud/getting-started/deployment-cli.md @@ -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: - - + + -```bash -yarn strapi login -``` + ```bash + yarn strapi login + ``` - - + + -```bash -npx run strapi login -``` + ```bash + npx run strapi login + ``` - - + + 4. In the browser window that opens automatically, confirm that the code displayed is the same as the one written in the terminal message. @@ -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: - - + + -```bash -yarn strapi deploy -``` + ```bash + yarn strapi deploy + ``` - - + + -```bash -npx run strapi deploy -``` + ```bash + npx run strapi deploy + ``` - - + + 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. \ No newline at end of file +- Check out the full [Command Line Interface documentation](/cloud/cli/cloud-cli) to learn about the other commands available. diff --git a/docusaurus/docs/cloud/projects/deploys.md b/docusaurus/docs/cloud/projects/deploys.md index e59c6e72b2..eef1d7b73a 100644 --- a/docusaurus/docs/cloud/projects/deploys.md +++ b/docusaurus/docs/cloud/projects/deploys.md @@ -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. diff --git a/docusaurus/docs/cloud/projects/settings.md b/docusaurus/docs/cloud/projects/settings.md index 48be7c2fd3..43984894ea 100644 --- a/docusaurus/docs/cloud/projects/settings.md +++ b/docusaurus/docs/cloud/projects/settings.md @@ -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)).