Allow CircleCI caches to be manually cleared #4759
gsmendoza
started this conversation in
New Features or Ideas
Replies: 1 comment 1 reply
-
I like the idea, @gsmendoza!
We probably need to do that BEFORE merging to master, to avoid the environment variable not being found. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goal
I would like to insert a UI environment variable to our CircleCI cache keys so that we can manually clear them if needed.
Background
We recently have a situation where the Ruby version in the
install_solidus
cache key doesn't match the Ruby version of the Rails app that was cached. As a result, the mismatch is causing the following error in CI:For examples, see:
Proposed implementation
Basing from https://support.circleci.com/hc/en-us/articles/115015426888-Clear-Project-Dependency-Cache, we can insert a UI environment variable to our two cache keys in our CircleCI config:
solidus-gems-v3-{{ .Environment.CACHE_VERSION }}-{{checksum ".ruby-version"}}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
solidus-installer-v5-{{ .Environment.CACHE_VERSION }}-{{ checksum "/tmp/.tool-versions" }}
We'll keep the existing cache version keys (v3 and v5) in the cache keys so that we'll still have the ability to reset the cache via source code change.
Prerequisites
To be safe, we need to seed the
CACHE_VERSION
environment variable in CircleCI before merging the PR to master.Post-merge changes
Once merged to master, we'll need to backport the change to older versions of Solidus.
Additional references
Beta Was this translation helpful? Give feedback.
All reactions