Cache
Description
This plugin enables you to cache build resources in an s3 compatible store for a Vela pipeline.
Source Code: https://github.com/go-vela/vela-s3-cache
Registry: https://hub.docker.com/r/target/vela-s3-cache
Usage
NOTE:
Users should refrain from using latest as the tag for the Docker image.
It is recommended to use a semantically versioned tag instead.
Sample of restoring a cache:
steps:
- name: restore_cache
image: target/vela-s3-cache:latest
pull: always
parameters:
action: restore
bucket: mybucket
server: mybucket.s3-us-west-2.amazonaws.com
Sample of rebuilding a cache:
steps:
- name: rebuild_cache
image: target/vela-s3-cache:latest
pull: always
parameters:
action: rebuild
bucket: mybucket
server: mybucket.s3-us-west-2.amazonaws.com
mount:
- .gradle
Sample of rebuilding a cache while preserving the directory structure:
steps:
- name: rebuild_cache
image: target/vela-s3-cache:latest
pull: always
parameters:
action: rebuild
bucket: mybucket
server: mybucket.s3-us-west-2.amazonaws.com
preserve_path: true
mount:
- foo/test1
- bar/test2
Sample of flushing a cache:
steps:
- name: flushing_cache
image: target/vela-s3-cache:latest
pull: always
parameters:
action: flush
bucket: mybucket
server: mybucket.s3-us-west-2.amazonaws.com
Secrets
NOTE: Users should refrain from configuring sensitive information in your pipeline in plain text.
Internal
Users can use Vela internal secrets to substitute these sensitive values at runtime:
steps:
- name: restore_cache
image: target/vela-s3-cache:latest
pull: always
+ secrets: [ s3_cache_access_key, s3_cache_secret_key ]
parameters:
action: restore
bucket: mybucket
server: mybucket.s3-us-west-2.amazonaws.com
- access_key: AKIAIOSFODNN7EXAMPLE
- secret_key: 123456789QWERTYEXAMPLE
This example will add the secrets to the
restore_cache
step as environment variables:
S3_CACHE_ACCESS_KEY=<value>
S3_CACHE_SECRET_KEY=<value>