nienbo / cache-buildkite-plugin

Tarball, Rsync & S3 Cache Kit for Buildkite. Supports Linux, macOS and Windows
https://buildkite.com/plugins
MIT License
67 stars 39 forks source link

[FEATURE REQUEST] Skip command if cache hit found #51

Open irphilli opened 2 years ago

irphilli commented 2 years ago

In the case for a command that is responsible for populating the cache, it would be helpful to go ahead and skip the command on a non-restore key cache hit. This can help optimize a flow if the command populating the cache takes some time (i.e. in a docker container, where the pull/startup takes time)

Something like:

steps:
  - label: Populate Cache
    command: ./populate_cache.sh
    plugins:
      - gencer/cache#v2.4.11:
        ...
        skip_command_on_cache_hit: true