Skip to content

Commit

Permalink
Update caching strategy to include node version (#1543)
Browse files Browse the repository at this point in the history
Update caching strategy to include node version

I looked into best practices and I wasn't able to find anyone that ran into problems with different node versions of the cache, however a similar problem frequently occurs when different architectures are used to build dependencies, and the solution is to include the architecture of the system in the cache key. So this approach is similar except we are adding the node version rather than the architecture to the cache key.

We can include the node version dynamically, however we would need to migrate over to Circle CI dynamic configuration in order to supply the node version as a parameter to the circle CI config.

J=SLAP-1547
TEST=manual

Inspect the cache key in Circle CI and confirm that it is correct
  • Loading branch information
cea2aj committed Aug 26, 2021
1 parent dffb8eb commit 71fac87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ commands:
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- v3-node-14-{{ checksum "package-lock.json" }}
# fallback to use the latest cache from the same node version if no exact match is found
- v3-node-14-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
key: v3-node-14-{{ checksum "package-lock.json" }}
deploy-to-aws:
description: "Deploys the dist directory to a given subdirectory of the answers bucket"
parameters:
Expand Down

0 comments on commit 71fac87

Please sign in to comment.