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

Add instructions for secrets in CLI #98

Merged
merged 10 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
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
25 changes: 24 additions & 1 deletion doc/user-guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Then, set your API key ([learn how to get it](../quickstart/apikey.md)):
ploomber-cloud key YOURKEY
```

(init)=
## Initialize a new app

If you want to create a new app, run the `init` command:
Expand Down Expand Up @@ -64,4 +65,26 @@ Then, execute:

```sh
ploomber-cloud deploy
```
```

## Defining environment variables
edublancas marked this conversation as resolved.
Show resolved Hide resolved

If your project uses environment variables, you can define them in an `.env` file.

In your main project directory, create an `.env` file. Open it in your code editor, and enter your environment variables. It should look like this:

```
MY_ENV_VAR_1=value_1
MY_ENV_VAR_2=value_2
```

Now make sure your project has been [initialized](#init), and deploy it:

```sh
ploomber-cloud deploy
```

The command-line interface will automatically read and encrypt your environment variables and include them in the deployment.
For security reasons, your `.env` file is replaced with an empty file at runtime. Ploomber only stores your encrypted environment variables.

To learn how to read your environment variables from within your application, see [Reading variables.](./env-vars.md)
5 changes: 5 additions & 0 deletions doc/user-guide/env-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ To add more, click on the button to the right:

![](../static/env-vars/env-vars-plus.png)


```{tip}
You can also define environment variables using the [command-line interface.](./cli.md)
```

## Reading variables

To read the variables, use the following Python code:
Expand Down