Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 36,069
    • Issues 36,069
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,299
    • Merge Requests 1,299
  • Requirements
    • Requirements
    • List
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #18986

Closed
Open
Created Aug 02, 2017 by Yahor Berdnikau@Tapchicoma2 of 3 tasks completed2/3 tasks

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
12.5
Milestone
12.5 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: gitlab-org/gitlab#18986