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 for downloading project w/ CLI #286

Merged
merged 1 commit into from
Oct 3, 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
29 changes: 23 additions & 6 deletions doc/user-guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,48 @@ 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:

```sh
ploomber-cloud init --from-existing
```

This will prompt you to choose from a list of your existing projects.
This command will:

Upon your choice, the command will generate a `ploomber-cloud.json` with your project's info. For example, if my app ID is `cool-tree-1860` and I'm deploying a `docker` app:
1. Prompt you to choose from a list of your existing projects.
2. Create a new directory named after your project ID (e.g., `./cool-tree-1860/`).
3. Download the project files into this new directory.
4. Generate a ploomber-cloud.json file with your project's information.


For example, if your app ID is `cool-tree-1860` and you're deploying a Docker app, the `./cool-tree-1860/ploomber-cloud.json` file might look like this:

```json
{
"id": "cool-tree-1860",
"type": "docker"
}
```

After initializing, you can deploy your project by going into this new directory:
```sh
cd cool-tree-1860
```

Then, execute:
```sh
ploomber-cloud deploy
```

## Download Configuration Only
If you want to download only the configuration file without the project code, use the --only-config flag:

```sh
ploomber-cloud deploy
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.

## 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 All @@ -92,10 +109,10 @@ ploomber-cloud init --force

This will replace the existing `ploomber-cloud.json` with a new one, with a different `id` field.

It can also be combined with the `--from-existing` for re-initializing from an existing project:
It can also be combined with the `--from-existing` and `--only-config` for re-initializing from an existing project:

```sh
ploomber-cloud init --from-existing --force
ploomber-cloud init --from-existing --only-config --force
```

## Ignore a file or directory
Expand Down
Loading