From fcbd68926768753fb768b5ed81ba75f538c15247 Mon Sep 17 00:00:00 2001 From: Latent Date: Fri, 4 Oct 2024 10:01:35 -0400 Subject: [PATCH 1/6] [Feature] Documentation on the `--config` flag when using `ploomber-cloud init` --- doc/user-guide/cli.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/user-guide/cli.md b/doc/user-guide/cli.md index 7a1934d2..0a3d03f2 100644 --- a/doc/user-guide/cli.md +++ b/doc/user-guide/cli.md @@ -55,7 +55,7 @@ When deploying from the terminal, it's recommended to use the `--watch` option. ## Configure an existing project -If you want to deploy an existing project, run the `init` command with the `--from-existing` flag: +If you want to deploy an existing project, run the `init` command with the `--from-existing` flag to download this one: ```sh ploomber-cloud init --from-existing @@ -88,6 +88,14 @@ Then, execute: ploomber-cloud deploy ``` +**Optional Configuration**: +You can use the `--config` flag with the `ploomber-cloud init --from-existing` command to specify a custom name for the configuration file instead of the default `ploomber-cloud.json`. When using this flag, only the file name will be considered, regardless of any specified path. For example: +```sh +ploomber-cloud init --from-existing --config ./specific-path/custom-config.json +``` + +This will create a configuration file named `custom-config.json` in the root of the downloaded project directory. + ## Download Configuration Only If you want to download only the configuration file without the project code, use the --only-config flag: @@ -97,6 +105,14 @@ ploomber-cloud init --from-existing --only-config This will generate only the ploomber-cloud.json file in your current directory, without creating a new project directory or downloading the project files. + +**Optional Configuration**: +You can use the `--config` flag in combination with `--only-config` to specify a custom name and location for the configuration file: +```sh +ploomber-cloud init --from-existing --only-config --config path/to/custom-config.json +``` +This allows you to tp choose a different name for the configuration file and the specify a different location to save the file. + ## Force initialize an app You might want to re-initialize your project in case the `ploomber-cloud.json` file has got corrupted or doesn't contain the valid keys. From 6d468b612569f2b4c3c691bba19ae21002c0f857 Mon Sep 17 00:00:00 2001 From: Latent Date: Fri, 4 Oct 2024 10:03:54 -0400 Subject: [PATCH 2/6] fix: typo --- doc/user-guide/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user-guide/cli.md b/doc/user-guide/cli.md index 0a3d03f2..75a2eb31 100644 --- a/doc/user-guide/cli.md +++ b/doc/user-guide/cli.md @@ -111,7 +111,7 @@ You can use the `--config` flag in combination with `--only-config` to specify a ```sh ploomber-cloud init --from-existing --only-config --config path/to/custom-config.json ``` -This allows you to tp choose a different name for the configuration file and the specify a different location to save the file. +This allows you to choose a different name for the configuration file and the specify a different location to save the file. ## Force initialize an app From 7d7b32d0e79282703e6f7886cc22c2fe7e19cdcf Mon Sep 17 00:00:00 2001 From: Latent Date: Fri, 4 Oct 2024 12:59:37 -0400 Subject: [PATCH 3/6] [Feature] Documentation on `--config` sub dir in `swtiching the config file section --- doc/user-guide/cli.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/user-guide/cli.md b/doc/user-guide/cli.md index 75a2eb31..3ecbe5b4 100644 --- a/doc/user-guide/cli.md +++ b/doc/user-guide/cli.md @@ -444,12 +444,15 @@ ploomber-cloud labels --sync By default, the CLI reads and writes to a `ploomber-cloud.json` file, but you can customize it via the `--config` (or its short version, `-c`), switching the config file is useful when you need to manage multiple environments (for example, development and production). -All commands that read or write the config file accept the `--config/-c` argument, for example: +All commands that read or write the config file accept the `--config/-c` argument. You can use this option to specify both alternative file names and sub-directory paths, for example: ```sh # create the config file in ploomber-cloud.dev.json ploomber-cloud init --config ploomber-cloud.dev.json # deploy using the dev config -ploomber-cloud deploy --config ploomber-cloud.dev.json +ploomber-cloud deploy --config ./config/ploomber-cloud.dev.json ``` + +> [!WARNING] +> The `ploomber-cloud init --from-existing` command which download the full source code behaves differently with the --config flag. When used with this specific command, only the file name from the --config argument is considered, and any specified path is ignored. From 7cc4de51fd63ac9ec661d323459499896333b27e Mon Sep 17 00:00:00 2001 From: Latent Date: Fri, 4 Oct 2024 13:02:30 -0400 Subject: [PATCH 4/6] chore: wrong rendering of `warning` --- doc/user-guide/cli.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/user-guide/cli.md b/doc/user-guide/cli.md index 3ecbe5b4..f48078b0 100644 --- a/doc/user-guide/cli.md +++ b/doc/user-guide/cli.md @@ -454,5 +454,7 @@ ploomber-cloud init --config ploomber-cloud.dev.json ploomber-cloud deploy --config ./config/ploomber-cloud.dev.json ``` -> [!WARNING] -> The `ploomber-cloud init --from-existing` command which download the full source code behaves differently with the --config flag. When used with this specific command, only the file name from the --config argument is considered, and any specified path is ignored. +```{warning} + +The `ploomber-cloud init --from-existing` command which download the full source code behaves differently with the --config flag. When used with this specific command, only the file name from the --config argument is considered, and any specified path is ignored. +``` From b525cfdda29b6b7e7c6c4de7505f2baf8da47ecd Mon Sep 17 00:00:00 2001 From: Latent Date: Fri, 4 Oct 2024 16:09:55 -0400 Subject: [PATCH 5/6] chore: simple `Refer to this section` to configure project --- doc/user-guide/cli.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/user-guide/cli.md b/doc/user-guide/cli.md index f48078b0..46cf3fab 100644 --- a/doc/user-guide/cli.md +++ b/doc/user-guide/cli.md @@ -53,6 +53,8 @@ ploomber-cloud deploy --watch-incremental When deploying from the terminal, it's recommended to use the `--watch` option. This flag clears the terminal before printing updated logs, ensuring a clean display. Alternatively, if you're storing deployment output in a file, such as with GitHub Actions, opt for `--watch-incremental`. This option skips clearing the screen and only prints new logs and status updates. + +(config)= ## Configure an existing project If you want to deploy an existing project, run the `init` command with the `--from-existing` flag to download this one: @@ -89,7 +91,7 @@ ploomber-cloud deploy ``` **Optional Configuration**: -You can use the `--config` flag with the `ploomber-cloud init --from-existing` command to specify a custom name for the configuration file instead of the default `ploomber-cloud.json`. When using this flag, only the file name will be considered, regardless of any specified path. For example: +You can use the `--config` flag with the `ploomber-cloud init --from-existing` command to specify a custom name for the configuration file instead of the default `ploomber-cloud.json`. When using this flag for downloading your project, only the file name will be considered, regardless of any specified path. For example: ```sh ploomber-cloud init --from-existing --config ./specific-path/custom-config.json ``` @@ -444,7 +446,7 @@ ploomber-cloud labels --sync By default, the CLI reads and writes to a `ploomber-cloud.json` file, but you can customize it via the `--config` (or its short version, `-c`), switching the config file is useful when you need to manage multiple environments (for example, development and production). -All commands that read or write the config file accept the `--config/-c` argument. You can use this option to specify both alternative file names and sub-directory paths, for example: +All commands that read or write the config file accept the `--config/-c` argument. You can use this option to specify both alternative file names and paths, for example: ```sh # create the config file in ploomber-cloud.dev.json @@ -454,7 +456,4 @@ ploomber-cloud init --config ploomber-cloud.dev.json ploomber-cloud deploy --config ./config/ploomber-cloud.dev.json ``` -```{warning} - -The `ploomber-cloud init --from-existing` command which download the full source code behaves differently with the --config flag. When used with this specific command, only the file name from the --config argument is considered, and any specified path is ignored. -``` +For more details on configuring projects, refer to [this section](config). From 39b8ba26e5be7e7a96ae1353dae0b0b36bd29b14 Mon Sep 17 00:00:00 2001 From: LatentDream Date: Mon, 7 Oct 2024 09:56:22 -0700 Subject: [PATCH 6/6] Update doc/user-guide/cli.md --- doc/user-guide/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user-guide/cli.md b/doc/user-guide/cli.md index 46cf3fab..8d604dc2 100644 --- a/doc/user-guide/cli.md +++ b/doc/user-guide/cli.md @@ -453,7 +453,7 @@ All commands that read or write the config file accept the `--config/-c` argumen ploomber-cloud init --config ploomber-cloud.dev.json # deploy using the dev config -ploomber-cloud deploy --config ./config/ploomber-cloud.dev.json +ploomber-cloud deploy --config ploomber-cloud.dev.json ``` For more details on configuring projects, refer to [this section](config).