CircleCI Ideas

Checksum key template should accept wildcards

The checksum key template accepts one file (see https://circleci.com/docs/2.0/configuration-reference/#save_cache), but I have a long running task that depends on many files leading to long cache keys that grow longer for each file added as a dependency. 

- restore_cache:
    keys:
      - v1-dependencies-{{ .Branch }}-{{ checksum "hyrax-batch_ingest.gemspec" }}-{{ checksum "spec/test_app_templates/lib/generators/test_app_generator.rb" }}-{{ checksum "lib/generators/hyrax/batch_ingest/install_generator.rb" }}-{{ checksum "lib/generators/hyrax/batch_ingest/templates/app/views/hyrax/dashboard/sidebar/_repository_content.html.erb" }}

 

My particular scenario is a Rails engine which builds a test application that needs to be rebuilt if any of the generators or generator template files change.  A workaround was offered by a CircleCI employee (https://discuss.circleci.com/t/caching-based-on-the-checksum-of-a-directorys-contents/28748), but it would be much nicer to have checksum support wildcards.  The above could then be simplified.

- restore_cache:
    keys:
      - v1-dependencies-{{ .Branch }}-{{ checksum "hyrax-batch_ingest.gemspec" }}-{{ checksum "*lib/generators/*" }}
  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • Jun 4 2019
  • New
  • Attach files