Skip to content

Commit

Permalink
[Feature] Documentation for downloading project
Browse files Browse the repository at this point in the history
  • Loading branch information
LatentDream committed Oct 3, 2024
1 parent 1462421 commit 06e190e
Showing 1 changed file with 23 additions and 6 deletions.
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

0 comments on commit 06e190e

Please sign in to comment.