Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: Update and add tips about usage in Docker and CI #208

Merged
merged 2 commits into from
Feb 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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|yarn] install`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify: this is pretty obvious once you realize it, but in addition to myself, others have apparently tripped over this as well, so thought that perhaps worth a mention.

- 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
Expand Down