Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Documentation on the --config flag when using init #287

Merged
merged 6 commits into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions doc/user-guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ 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:
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
Expand Down Expand Up @@ -88,6 +90,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 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
```

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:

Expand All @@ -97,6 +107,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 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.
Expand Down Expand Up @@ -428,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, 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
Expand All @@ -437,3 +455,5 @@ ploomber-cloud init --config ploomber-cloud.dev.json
# deploy using the dev config
ploomber-cloud deploy --config ploomber-cloud.dev.json
```

For more details on configuring projects, refer to [this section](config).