Skip to content

Commit

Permalink
Add patches hash to NPM packages cache key (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekn committed May 24, 2024
1 parent cb660ba commit 0997b92
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .buildkite/commands/install-node-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ ARCHITECTURE=$(uname -m)
NODE_VERSION=$(node --version)
PACKAGE_HASH=$(hash_file package-lock.json)

CACHEKEY="$BUILDKITE_PIPELINE_SLUG-npm-$PLATFORM-$ARCHITECTURE-node-$NODE_VERSION-$PACKAGE_HASH"
if [ -d patches ]; then
PATCHES_HASH=$(hash_directory patches/)
else
PATCHES_HASH=nopatch
fi

CACHEKEY="$BUILDKITE_PIPELINE_SLUG-npm-$PLATFORM-$ARCHITECTURE-node-$NODE_VERSION-$PACKAGE_HASH-$PATCHES_HASH"

LOCAL_NPM_CACHE=./vendor/npm
mkdir -p $LOCAL_NPM_CACHE
Expand Down

0 comments on commit 0997b92

Please sign in to comment.