Skip to content

Commit

Permalink
feat: add docs on local environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-fletcher committed Dec 13, 2022
1 parent 9dcf280 commit cb0c35f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
23 changes: 21 additions & 2 deletions docs/custom-remote-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ nav_order: 5

# Enable custom remote caching in your Turborepo monorepo

To enable a custom remote caching server in your Turborepo monorepo, you must add a config file by hand. The `turbo login` command works only with the official Vercel server.
To enable a custom remote caching server in your Turborepo monorepo, you must
either add a config file by hand or set local environment variables.

## Config file

You must add the config file by hand. The `turbo login` command works only with the official Vercel server.

1. create `.turbo` folder at the root of your monorepo
2. create `config.json` file inside it, and add these properties:
Expand Down Expand Up @@ -37,9 +42,23 @@ For example:
//...
```

## Enable remote caching in Docker
### Enable remote caching in Docker
For some reason, the `.turbo/config.json` is not working in Docker containers. In order to enable remote caching in Docker, you need to pass the configuration via CLI arguments.

```json
"build": "turbo run build --team=\"team_awesome\" --token=\"turbotoken\" --api=\"https://your-caching.server.dev\"",
```

## Local environment variables

You can also configure your developer environment by setting the following
environment variables:

| Variable | Type | Description |
| ------------- | ------ | ----------- |
| `TURBO_API` | string | The address of a running `turborepo-remote-cache` server |
| `TURBO_TEAM` | string | The team id (see *Config file* above)|
| `TURBO_TOKEN` | string | Your secret key. This must be the same as the `TURBO_TOKEN` variable set on your turborepo-remote-cache server |

**Note, these environment variables are used by the Turborepo CLI, so should not
be confused with the environment variables used to configure your server!**
20 changes: 9 additions & 11 deletions docs/running-in-lambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ sometimes cause timeouts).
Go into **Environment variables** and create the following environment
variables:

| Key | Value |
|------------------|--------------------|
| STORAGE_PATH | <your_bucket_name> |
| STORAGE_PROVIDER | s3 |
| TURBO_TOKEN | <your_secret_key> |
| Variable | Value |
|--------------------|--------------------|
| `STORAGE_PATH` | <your_bucket_name> |
| `STORAGE_PROVIDER` | s3 |
| `TURBO_TOKEN` | <your_secret_key> |

*See [Environment
variables](https://ducktors.github.io/turborepo-remote-cache/environment-variables)
Expand Down Expand Up @@ -124,12 +124,10 @@ set up your repository.

## Configuring your repository to use the new API

You will need to enable custom remote caching in your turbo repository - see -
[Enable custom remote caching in a Turborepo
You will need to enable custom remote caching in your turbo repository. Your
**Invoke URL** is your Turborepo API URL, see [Enable custom remote caching in a
Turborepo
monorepo](https://ducktors.github.io/turborepo-remote-cache/custom-remote-caching)
for more information.

In your `.turbo/config.json`, set your `apiUrl` to your API Gateway **Invoke
URL**.
for more information on how to configure this.

Your remote `turborepo-remote-cache` API is now ready to use!

0 comments on commit cb0c35f

Please sign in to comment.