Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,758
    • Issues 44,758
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,331
    • Merge requests 1,331
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #18986
Closed
Open
Issue created Aug 02, 2017 by Yahor Berdnikau@Tapchicoma2 of 3 checklist items completed2/3 checklist items

Allow to use file checksum as cache key

Description

Provide a way to use project file checksum as a cache key. This will speed up pipeline execution time for many users.

Proposal

Add ability to specify key to CI YAML:

rspec:
  cache:
    key:
      files: Gemfile # generate checksum based on SHA as the `cache:key` value
      prefix: add-something

We would internally set cache:key to "add-something-#{SHA256(File.read(Gemfile))".

Links / references

Documentation blurb

Overview

Currently Gitlab CI doesn't allow to run scripts or have ability to provide project commit checksum in cache key directive.

I have a java project that uses gradle as a build system. In this project all dependencies are defined in a separate file. I would like to recreate gradle cache only when this file has changed.

Other build systems will also can benefit from this approach if projects will put all dependencies in one file.

Use cases

Feature checklist

Make sure these are completed before closing the issue, with a link to the relevant commit.

  • Feature assurance
  • Documentation
  • Added to features.yml
Edited Jan 20, 2020 by Jason Yavorska
Assignee
Assign to
Time tracking