Pipelines cache definitions with glob support

Issue #15153 open
Alexandros Fotiadis created an issue

It would be nice to choose a single cache-definitions with provided Glob selection.

The current solution looks like this:

pipelines:
  default:
    - step:
        caches:
          - root
          - service-graphql
          - service-integrations
          - service-logging
definitions:
  caches:
    root: node_modules
    service-graphql: services/graphql/node_modules
    service-integrations: services/integrations/node_modules
    service-logging: services/logging/node_modules

A more convenient solution would be to use globs as dynamic caching definitions. This is cleaner and the developer does't need to maintain the file each time a new service is added to the project.

Expectation:

pipelines:
  default:
    - step:
        caches:
          - root
          - services

definitions:
  caches:
    root: node_modules
    services: services/*/node_modules

Comments (9)

  1. Matt Ryall

    Thanks for the suggestion. I agree globbing would make your situation much easier. I'll see what the level of difficulty on this is and whether we can address it in the short term.

  2. Matt Ryall

    Unfortunately, due to how we store and restore caches, adding globbing support isn't straightforward. We'll keep this on our queue for future consideration.

    Thanks again for reporting it.

  3. Vitalik Zaidman

    +1

    we use monorepo (with lerna)

    and we need to cache monorepo packages:

    packages/package-a/node_modules

    packages/package-b/node_modules

    packages/package-c/node_modules

  4. Log in to comment