From 5a5dbd2ba754f3bff1f2703fd87a921127a3fe62 Mon Sep 17 00:00:00 2001 From: Salvatore Randazzo Date: Tue, 27 Oct 2020 15:23:27 -0400 Subject: [PATCH 1/4] Update CI instructions in Readme Updates instructions/example for CI/CircleCI to be clearer. Takes recommendation from: https://github.com/ds300/patch-package/issues/273 to fix md5 not working on CircleCI --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7f723f8a..b0692038 100644 --- a/README.md +++ b/README.md @@ -75,10 +75,19 @@ For `patch-package` to work on Heroku applications, you must specify [`NPM_CONFI Otherwise if you update a patch then the change may not be reflected on subsequent CI runs. - E.g., for CircleCI: before loading/saving your cache run `cat patches/* | md5 > patches.hash` - and then update your hash key to include a checksum of that file, - `{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }}`. + #### CircleCI example + Before loading/saving your cache, run `md5sum patches/* > patches.hash` + ```yaml + - run: + name: patch-package hash + command: md5sum patches/* > patches.hash + ``` + Then, update your hash key to include a checksum of that file: + ```yaml + - restore_cache: + key: app-node_modules-v1-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }} + ``` ## Usage From 6df9d69f81edf549c5e54c72b09e18342d6174f9 Mon Sep 17 00:00:00 2001 From: Salvatore Randazzo Date: Tue, 27 Oct 2020 15:29:38 -0400 Subject: [PATCH 2/4] Update README.md Also add save_cache --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index b0692038..493a654f 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,14 @@ For `patch-package` to work on Heroku applications, you must specify [`NPM_CONFI - restore_cache: key: app-node_modules-v1-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }} ``` + + As well as the save_cache + ```yaml + - save_cache: + key: app-node_modules-v1-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }} + paths: + - ./node_modules + ``` ## Usage From 06897b8b7886fc16e9474ec74fce3a3654d21f0e Mon Sep 17 00:00:00 2001 From: Salvatore Randazzo Date: Tue, 27 Oct 2020 15:31:24 -0400 Subject: [PATCH 3/4] Update README.md yaml spacing --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 493a654f..84af56a3 100644 --- a/README.md +++ b/README.md @@ -90,11 +90,11 @@ For `patch-package` to work on Heroku applications, you must specify [`NPM_CONFI ``` As well as the save_cache - ```yaml + ```yaml - save_cache: key: app-node_modules-v1-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }} paths: - - ./node_modules + - ./node_modules ``` ## Usage From 90f0429c6e5ce0556408d610251e914583015de6 Mon Sep 17 00:00:00 2001 From: Salvatore Randazzo Date: Thu, 29 Oct 2020 10:48:19 -0400 Subject: [PATCH 4/4] Specify MacOS vs Linux --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 84af56a3..ec6acd47 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ For `patch-package` to work on Heroku applications, you must specify [`NPM_CONFI subsequent CI runs. #### CircleCI example - Before loading/saving your cache, run `md5sum patches/* > patches.hash` + Create a hash of your patches before loading/saving your cache. If using a Linux machine, run `md5sum patches/* > patches.hash`. If running on a macOS machine, use `md5 patches/* > patches.hash` ```yaml - run: name: patch-package hash