From bb17ad4e9e7d760da5817bf3a2d527cc48caa671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20H=C3=A4likk=C3=A4?= Date: Wed, 19 Feb 2020 23:51:57 +0200 Subject: [PATCH 1/2] Update and add tips about usage in Docker and CI --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ca933b8d..de4572b0 100644 --- a/README.md +++ b/README.md @@ -59,16 +59,21 @@ need to repeat the setup process for the child package. Also make sure you're in the child package directory when you run `patch-package` to generate the patch files. -### CI +### Docker and CI -- Gitlab Docker builds, see - [#185](https://github.com/ds300/patch-package/issues/185) +- If having errors about working directory ("cannot run in wd [...]") when + building in Docker, you might need to adjust configuration in `.npmrc`. See + [#185](https://github.com/ds300/patch-package/issues/185). +- In your `Dockerfile`, remember to copy over the patch files *before* running + `npm install` - If you cache `node_modules` rather than running `yarn install` every time, make sure that the `patches` dir is included in your cache key somehow. Otherwise if you update a patch then the change may not be reflected on subsequent CI runs. - e.g. for cirlce ci before loading/saving you 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" }}` + 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" }}`. ## Usage From 3b38e64ded338d0b12944cc8413afdcd27d4cd31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20H=C3=A4likk=C3=A4?= Date: Thu, 20 Feb 2020 09:07:52 +0200 Subject: [PATCH 2/2] Add 'yarn install' to match 'npm install' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de4572b0..617d718c 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ files. building in Docker, you might need to adjust configuration in `.npmrc`. See [#185](https://github.com/ds300/patch-package/issues/185). - In your `Dockerfile`, remember to copy over the patch files *before* running - `npm install` + `[npm|yarn] install` - If you cache `node_modules` rather than running `yarn install` every time, make sure that the `patches` dir is included in your cache key somehow. Otherwise if you update a patch then the change may not be reflected on