Skip to content
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
51 changes: 48 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,25 @@ The `BUILDKITE_PLUGIN_FS_CACHE_FOLDER` environment variable defines where the co

**IMPORTANT**: the `fs` backend just copies files to a different location in the current agent, as it is not a shared or external resource, its caching possibilities are quite limited.

#### Example

```yaml
env:
BUILDKITE_PLUGIN_FS_CACHE_FOLDER: "/var/cache/buildkite" # Optional: where to store cache on the agent.

steps:
- label: ':nodejs: Install dependencies'
command: npm ci
plugins:
- cache#v1.7.0:
backend: fs
path: node_modules
manifest: package-lock.json
restore: file
save: file
compression: tgz # Optional compression
```

#### `s3`

Store things in an S3 bucket. You need to make sure that the `aws` command is available and appropriately configured.
Expand All @@ -82,6 +101,29 @@ You also need the agent to have access to the following defined environment vari

Setting the `BUILDKITE_PLUGIN_S3_CACHE_ONLY_SHOW_ERRORS` environment variable will reduce logging of file operations towards S3.


#### Example

```yaml
env:
BUILDKITE_PLUGIN_S3_CACHE_BUCKET: "my-cache-bucket" # Required: S3 bucket to store cache objects
BUILDKITE_PLUGIN_S3_CACHE_PREFIX: "buildkite/cache"
BUILDKITE_PLUGIN_S3_CACHE_ENDPOINT: "https://<your-endpoint>"
BUILDKITE_PLUGIN_S3_CACHE_ONLY_SHOW_ERRORS: "true"

steps:
- label: ':nodejs: Install dependencies'
command: npm ci
plugins:
- cache#v1.7.0:
backend: s3
path: node_modules
manifest: package-lock.json
restore: file
save: file
compression: zstd
```

### `compression` (string)

Allows for the cached file/folder to be saved/restored as a single file. You will need to make sure to use the same compression when saving and restoring or it will cause a cache miss.
Expand Down Expand Up @@ -190,7 +232,8 @@ steps:
command: npm ci
plugins:
- cache#v1.7.0:
manifest: package-lock.json
manifest:
- package-lock.json
path: node_modules
restore: pipeline
save:
Expand All @@ -201,7 +244,8 @@ steps:
command: npm test # does not save cache, not necessary
plugins:
- cache#v1.7.0:
manifest: package-lock.json
manifest:
- package-lock.json
path: node_modules
restore: file
- wait: ~ # don't run deploy until tests pass
Expand All @@ -210,7 +254,8 @@ steps:
command: npm run deploy
plugins:
- cache#v1.7.0:
manifest: package-lock.json
manifest:
- package-lock.json
path: node_modules
restore: file
save:
Expand Down