From ed23402ae42dcdcf19abe711eb878081f323a61a Mon Sep 17 00:00:00 2001 From: "mateusz.anglart" Date: Mon, 24 Apr 2023 19:33:41 +0200 Subject: [PATCH 1/5] chore: documentation for admin js cli --- SUMMARY.md | 2 +- ...ng&deploying-the-application-using-cli.md} | 33 ++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) rename deployment/{deploying-the-application-using-cli.md => creating&deploying-the-application-using-cli.md} (61%) diff --git a/SUMMARY.md b/SUMMARY.md index 963115e..f9fea04 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -75,7 +75,7 @@ * [Overview](deployment/overview.md) * [Create an Application](deployment/create-an-application.md) * [Generate API Key & Secret](deployment/generate-api-key-and-secret.md) -* [Deploying the application using CLI](deployment/deploying-the-application-using-cli.md) +* [Creating and Deploying the application using cli](deployment/creating&deploying-the-application-using-cli.md) * [Editing environment variables](deployment/editing-environment-variables.md) *** diff --git a/deployment/deploying-the-application-using-cli.md b/deployment/creating&deploying-the-application-using-cli.md similarity index 61% rename from deployment/deploying-the-application-using-cli.md rename to deployment/creating&deploying-the-application-using-cli.md index 4062399..e2490a2 100644 --- a/deployment/deploying-the-application-using-cli.md +++ b/deployment/creating&deploying-the-application-using-cli.md @@ -1,13 +1,15 @@ -# Deploying the application using CLI +# AdminJS Cloud CLI for creating and deploing application AdminJS Cloud Hosting comes with a CLI tool which you can use locally or inside your CI/CD to deploy your application. ## Installation {% code overflow="wrap" %} + ```bash -$ npm i -g @adminjs/cloud-cli +npm i -g @adminjs/cloud-cli ``` + {% endcode %} ## Configuration @@ -23,6 +25,7 @@ include string[] A list of files/directories you wish to deploy. ### Example {% code title="adminjs-cloud.json" %} + ```json { "include": [ @@ -36,6 +39,7 @@ include string[] A list of files/directories you wish to deploy. ] } ``` + {% endcode %} ### Starting the application @@ -43,6 +47,7 @@ include string[] A list of files/directories you wish to deploy. Currently, AdminJS Cloud Hosting requires `start` script to be present in your `package.json` file. This is the command you use to start your application: {% code title="package.json" %} + ```json { ..., @@ -52,16 +57,36 @@ Currently, AdminJS Cloud Hosting requires `start` script to be present in your ` } } ``` + {% endcode %} In the future, we plan to extend application's configuration so that you can provide a custom start command. ## Commands -As of version `1.1.0` the CLI only allows you to deploy your application. +As of version `1.2.0` the CLI only allows you to create and deploy your application. To use `@adminjs/cloud-cli` you must first request an application in [Pricing](https://adminjs.co/pricing) page and generate an API Key & API Secret. +### #create + +The `create` command allows you to create basic admin JS application with basic authentication. The CLI only generates only code for running it, you have to use commands `yarn && yarn build && yarn start` to check if setup is complete succesfully, if you fallow all the steps correctly. + +#### Parameters + +``` +name string required The name of your application +database string required The connection string todatabase eg. `postgres://adminjs:adminjs@localhost:5432/adminjs` +apiKey string required Your API Key +apiSecret string required Your API Secret +config string optional Path to your configuration file (relative to PWD) +``` + +#### Usage + +```bash +adminjs-cloud create --name= --database= --apiKey= --apiSecret= +``` ### #deploy The `deploy` command allows you to deploy your source code. The CLI assumes your code is already built and whatever files you choose to `include` in your configuration file are enough to start your application. @@ -77,5 +102,5 @@ config string optional Path to your configuration file (rel #### Usage ```bash -$ adminjs-cloud deploy --apiKey= --apiSecret= --config=[string] +adminjs-cloud deploy --apiKey= --apiSecret= --config=[string] ``` From a5f44547ffeef4065edd917f2418d7007f480ae3 Mon Sep 17 00:00:00 2001 From: "mateusz.anglart" Date: Mon, 24 Apr 2023 21:06:31 +0200 Subject: [PATCH 2/5] chore: fix review comments --- SUMMARY.md | 2 +- .../creating&deploying-the-application-using-cli.md | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SUMMARY.md b/SUMMARY.md index f9fea04..d915d28 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -75,7 +75,7 @@ * [Overview](deployment/overview.md) * [Create an Application](deployment/create-an-application.md) * [Generate API Key & Secret](deployment/generate-api-key-and-secret.md) -* [Creating and Deploying the application using cli](deployment/creating&deploying-the-application-using-cli.md) +* [Creating and Deploying the application using CLI](deployment/creating&deploying-the-application-using-cli.md) * [Editing environment variables](deployment/editing-environment-variables.md) *** diff --git a/deployment/creating&deploying-the-application-using-cli.md b/deployment/creating&deploying-the-application-using-cli.md index e2490a2..e9cbbaf 100644 --- a/deployment/creating&deploying-the-application-using-cli.md +++ b/deployment/creating&deploying-the-application-using-cli.md @@ -1,4 +1,4 @@ -# AdminJS Cloud CLI for creating and deploing application +# AdminJS Cloud CLI for creating and deploing the application AdminJS Cloud Hosting comes with a CLI tool which you can use locally or inside your CI/CD to deploy your application. @@ -7,7 +7,7 @@ AdminJS Cloud Hosting comes with a CLI tool which you can use locally or inside {% code overflow="wrap" %} ```bash -npm i -g @adminjs/cloud-cli +$ npm i -g @adminjs/cloud-cli ``` {% endcode %} @@ -70,13 +70,13 @@ To use `@adminjs/cloud-cli` you must first request an application in [Pricing](h ### #create -The `create` command allows you to create basic admin JS application with basic authentication. The CLI only generates only code for running it, you have to use commands `yarn && yarn build && yarn start` to check if setup is complete succesfully, if you fallow all the steps correctly. +The `create` command allows you to create basic AdminJS application with basic authentication. The CLI generates only code for running it, you have to use commands `yarn && yarn build && yarn start` to check if setup is complete succesfully, if you follow all the steps correctly. #### Parameters ``` name string required The name of your application -database string required The connection string todatabase eg. `postgres://adminjs:adminjs@localhost:5432/adminjs` +database string required The connection string to database eg. `postgres://adminjs:adminjs@localhost:5432/adminjs` apiKey string required Your API Key apiSecret string required Your API Secret config string optional Path to your configuration file (relative to PWD) @@ -85,7 +85,7 @@ config string optional Path to your configuration file (rel #### Usage ```bash -adminjs-cloud create --name= --database= --apiKey= --apiSecret= +$ adminjs-cloud create --name= --database= --apiKey= --apiSecret= ``` ### #deploy @@ -102,5 +102,5 @@ config string optional Path to your configuration file (rel #### Usage ```bash -adminjs-cloud deploy --apiKey= --apiSecret= --config=[string] +$ adminjs-cloud deploy --apiKey= --apiSecret= --config=[string] ``` From ad08796e7693d0272308fffc6234a3a40999bd79 Mon Sep 17 00:00:00 2001 From: "mateusz.anglart" Date: Tue, 25 Apr 2023 10:27:59 +0200 Subject: [PATCH 3/5] chore: fix review comments2 --- SUMMARY.md | 2 +- ...g-cli.md => creating-deploying-the-application-using-cli.md} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename deployment/{creating&deploying-the-application-using-cli.md => creating-deploying-the-application-using-cli.md} (97%) diff --git a/SUMMARY.md b/SUMMARY.md index d915d28..aa75069 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -75,7 +75,7 @@ * [Overview](deployment/overview.md) * [Create an Application](deployment/create-an-application.md) * [Generate API Key & Secret](deployment/generate-api-key-and-secret.md) -* [Creating and Deploying the application using CLI](deployment/creating&deploying-the-application-using-cli.md) +* [Creating and Deploying the application using CLI](deployment/creating-deploying-the-application-using-cli.md) * [Editing environment variables](deployment/editing-environment-variables.md) *** diff --git a/deployment/creating&deploying-the-application-using-cli.md b/deployment/creating-deploying-the-application-using-cli.md similarity index 97% rename from deployment/creating&deploying-the-application-using-cli.md rename to deployment/creating-deploying-the-application-using-cli.md index e9cbbaf..c8a5b58 100644 --- a/deployment/creating&deploying-the-application-using-cli.md +++ b/deployment/creating-deploying-the-application-using-cli.md @@ -1,4 +1,4 @@ -# AdminJS Cloud CLI for creating and deploing the application +# AdminJS Cloud CLI for creating and deploying the application AdminJS Cloud Hosting comes with a CLI tool which you can use locally or inside your CI/CD to deploy your application. From 6639539bb5c75a399d76ce5062c9c1b1ec0e0833 Mon Sep 17 00:00:00 2001 From: "mateusz.anglart" Date: Wed, 26 Apr 2023 15:48:50 +0200 Subject: [PATCH 4/5] chore: change npm to yarn --- deployment/creating-deploying-the-application-using-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/creating-deploying-the-application-using-cli.md b/deployment/creating-deploying-the-application-using-cli.md index c8a5b58..e93b590 100644 --- a/deployment/creating-deploying-the-application-using-cli.md +++ b/deployment/creating-deploying-the-application-using-cli.md @@ -7,7 +7,7 @@ AdminJS Cloud Hosting comes with a CLI tool which you can use locally or inside {% code overflow="wrap" %} ```bash -$ npm i -g @adminjs/cloud-cli +$ yarn global add @adminjs/cloud-cli ``` {% endcode %} From f6ca6a8ec7a95a207676c4515436f3b4fd39fee8 Mon Sep 17 00:00:00 2001 From: "mateusz.anglart" Date: Thu, 27 Apr 2023 10:16:49 +0200 Subject: [PATCH 5/5] fix: add requierments --- deployment/creating-deploying-the-application-using-cli.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deployment/creating-deploying-the-application-using-cli.md b/deployment/creating-deploying-the-application-using-cli.md index e93b590..b612f3d 100644 --- a/deployment/creating-deploying-the-application-using-cli.md +++ b/deployment/creating-deploying-the-application-using-cli.md @@ -2,6 +2,13 @@ AdminJS Cloud Hosting comes with a CLI tool which you can use locally or inside your CI/CD to deploy your application. +## Requierments + +Before you will make installation and configuration steps make sure you met all the requirements below. + +- Node.js >=18 (we recommend latest LTS version) +- yarn installed globally (`npm install --global yarn`) + ## Installation {% code overflow="wrap" %}