{"action":"created","comment":{"url":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/comments/64202451","id":64202451,"diff_hunk":"@@ -8,6 +8,36 @@ This project holds various deployment scripts that are used with AWS CodeDeploy\n \n This will check if the `package.json` version has been updated for a project and then create a new release on github after running `npm build` and commiting any changed release assets in the `dist` directory.\n \n+### `cachedInstallModules.sh`\n+\n+This can speed up installation of node modules on hosted CI. It stores a hash of the `package.json` into the node_modules directory and uses it to determine if we may need to reinstall. Alongside this, it can automatically upgrade `npm`, and wipe out the cached node_modules directory if `package.json` has changed (to ensure unused modules are removed, and that new releases satisfying the current version range are updated to).\n+\n+Use and configure with package.json:\n+\n+```\n+  \"scripts\": {\n+    \"install:cached\": \"rm -rf ./deployment-helpers && git clone https://github.com/holidayextras/deployment-helpers.git && ./deployment-helpers/nodeApps/cachedInstallModules.sh\"\n+  },\n+  \"config\": {\n+    \"nodeModuleCaching\": {\n+      // \"clear\", \"prune\" or omit.\n+      // \"clear\" is slower, but will pick up all available updates to modules\n+      // \"prune\" is faster, but will continue using already-cached modules if\n+      //   they still satisfy the range. Extraneous modules are removed.\n+      // If omitted, the usual approach of simply running `npm install` is used,\n+      // which will not install available updates or remove extraneous modules.\n+      \"strategy\": \"clear\",\n+\n+      // Which npm version to install. Omit to use the existing default.\n+      \"npmVersion\": 3,","path":"README.md","position":25,"original_position":25,"commit_id":"0594a61e304b66ac0a30e44db9e13c55acd5fb43","original_commit_id":"0594a61e304b66ac0a30e44db9e13c55acd5fb43","user":{"login":"hx-markterry","id":3158640,"avatar_url":"https://avatars.githubusercontent.com/u/3158640?v=3","gravatar_id":"","url":"https://api.github.com/users/hx-markterry","html_url":"https://github.com/hx-markterry","followers_url":"https://api.github.com/users/hx-markterry/followers","following_url":"https://api.github.com/users/hx-markterry/following{/other_user}","gists_url":"https://api.github.com/users/hx-markterry/gists{/gist_id}","starred_url":"https://api.github.com/users/hx-markterry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hx-markterry/subscriptions","organizations_url":"https://api.github.com/users/hx-markterry/orgs","repos_url":"https://api.github.com/users/hx-markterry/repos","events_url":"https://api.github.com/users/hx-markterry/events{/privacy}","received_events_url":"https://api.github.com/users/hx-markterry/received_events","type":"User","site_admin":false},"body":"could this be taken from a project's dependency list?","created_at":"2016-05-23T10:48:21Z","updated_at":"2016-05-23T10:48:21Z","html_url":"https://github.com/holidayextras/deployment-helpers/pull/11#discussion_r64202451","pull_request_url":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/comments/64202451"},"html":{"href":"https://github.com/holidayextras/deployment-helpers/pull/11#discussion_r64202451"},"pull_request":{"href":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/11","id":70715773,"html_url":"https://github.com/holidayextras/deployment-helpers/pull/11","diff_url":"https://github.com/holidayextras/deployment-helpers/pull/11.diff","patch_url":"https://github.com/holidayextras/deployment-helpers/pull/11.patch","issue_url":"https://api.github.com/repos/holidayextras/deployment-helpers/issues/11","number":11,"state":"open","locked":false,"title":"Better node module caching","user":{"login":"shackpank","id":655660,"avatar_url":"https://avatars.githubusercontent.com/u/655660?v=3","gravatar_id":"","url":"https://api.github.com/users/shackpank","html_url":"https://github.com/shackpank","followers_url":"https://api.github.com/users/shackpank/followers","following_url":"https://api.github.com/users/shackpank/following{/other_user}","gists_url":"https://api.github.com/users/shackpank/gists{/gist_id}","starred_url":"https://api.github.com/users/shackpank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shackpank/subscriptions","organizations_url":"https://api.github.com/users/shackpank/orgs","repos_url":"https://api.github.com/users/shackpank/repos","events_url":"https://api.github.com/users/shackpank/events{/privacy}","received_events_url":"https://api.github.com/users/shackpank/received_events","type":"User","site_admin":false},"body":"#### What does this PR do? (please provide any background)\r\n\r\nTakes a script we've got on our internal 'tripapp' project to speed up the `npm install` step on Travis, improves its options and documentation, and adds it to this repo as a shareable script that other repos can opt into.\r\n\r\n#### What tests does this PR have?\r\n#### How can this be tested?\r\n\r\n[This tripapp PR](https://github.com/holidayextras/tripapplite/pull/3867) uses it, instead of a script checked into the repo.\r\n\r\nYou can test the other options by branching from it and trying repeating the build to ensure it's cached, changing the strategies or forcing updates to make sure all that behaves as expected.\r\n\r\nI used [a repository like this](https://github.com/shackpank/output-stuff-on-install) to verify the behaviour described when version numbers / tags are updated (basically that binning the node_modules directory is the only way to guarantee it happens)\r\n\r\n#### Screenshots / Screencast\r\n#### What gif best describes how you feel about this work?\r\n\r\n![ns9tpdx](https://cloud.githubusercontent.com/assets/655660/15399279/f136ee50-1dde-11e6-95e8-6ac59bf8ff0d.gif)\r\n\r\n---\r\n\r\n- [x] I have checked our general [contributing document](https://github.com/holidayextras/culture/blob/master/CONTRIBUTING.md) and the project specific [contributing document](../blob/master/CONTRIBUTING.md) (if present) and I'm happy for this to be reviewed.\r\n\r\n#### Reviewers\r\n\r\n**Review 1**\r\n- [ ] :+1:\r\n\r\n**Review 2**\r\n- [x] :+1:\r\n\r\n**Review 3**\r\n- [ ] :+1:\r\n\r\nBy adding a +1 you are confirming you have...\r\n- Witnessed the work behaving as expected (this could be on the author's machine or screencast).\r\n- Checked for coding anti-patterns.\r\n- Checked for appropriate test coverage.\r\n- Checked all the tests are passing.\r\n","created_at":"2016-05-19T15:32:42Z","updated_at":"2016-05-23T10:48:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11800511f39a785f91028c0f1888a622e075ed98","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/11/commits","review_comments_url":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/11/comments","review_comment_url":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/holidayextras/deployment-helpers/issues/11/comments","statuses_url":"https://api.github.com/repos/holidayextras/deployment-helpers/statuses/0594a61e304b66ac0a30e44db9e13c55acd5fb43","head":{"label":"holidayextras:module_caching","ref":"module_caching","sha":"0594a61e304b66ac0a30e44db9e13c55acd5fb43","user":{"login":"holidayextras","id":286993,"avatar_url":"https://avatars.githubusercontent.com/u/286993?v=3","gravatar_id":"","url":"https://api.github.com/users/holidayextras","html_url":"https://github.com/holidayextras","followers_url":"https://api.github.com/users/holidayextras/followers","following_url":"https://api.github.com/users/holidayextras/following{/other_user}","gists_url":"https://api.github.com/users/holidayextras/gists{/gist_id}","starred_url":"https://api.github.com/users/holidayextras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holidayextras/subscriptions","organizations_url":"https://api.github.com/users/holidayextras/orgs","repos_url":"https://api.github.com/users/holidayextras/repos","events_url":"https://api.github.com/users/holidayextras/events{/privacy}","received_events_url":"https://api.github.com/users/holidayextras/received_events","type":"Organization","site_admin":false},"repo":{"id":43201844,"name":"deployment-helpers","full_name":"holidayextras/deployment-helpers","owner":{"login":"holidayextras","id":286993,"avatar_url":"https://avatars.githubusercontent.com/u/286993?v=3","gravatar_id":"","url":"https://api.github.com/users/holidayextras","html_url":"https://github.com/holidayextras","followers_url":"https://api.github.com/users/holidayextras/followers","following_url":"https://api.github.com/users/holidayextras/following{/other_user}","gists_url":"https://api.github.com/users/holidayextras/gists{/gist_id}","starred_url":"https://api.github.com/users/holidayextras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holidayextras/subscriptions","organizations_url":"https://api.github.com/users/holidayextras/orgs","repos_url":"https://api.github.com/users/holidayextras/repos","events_url":"https://api.github.com/users/holidayextras/events{/privacy}","received_events_url":"https://api.github.com/users/holidayextras/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/holidayextras/deployment-helpers","description":"A collection of scripts that can be used as part of a deployment process.","fork":false,"url":"https://api.github.com/repos/holidayextras/deployment-helpers","forks_url":"https://api.github.com/repos/holidayextras/deployment-helpers/forks","keys_url":"https://api.github.com/repos/holidayextras/deployment-helpers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/holidayextras/deployment-helpers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/holidayextras/deployment-helpers/teams","hooks_url":"https://api.github.com/repos/holidayextras/deployment-helpers/hooks","issue_events_url":"https://api.github.com/repos/holidayextras/deployment-helpers/issues/events{/number}","events_url":"https://api.github.com/repos/holidayextras/deployment-helpers/events","assignees_url":"https://api.github.com/repos/holidayextras/deployment-helpers/assignees{/user}","branches_url":"https://api.github.com/repos/holidayextras/deployment-helpers/branches{/branch}","tags_url":"https://api.github.com/repos/holidayextras/deployment-helpers/tags","blobs_url":"https://api.github.com/repos/holidayextras/deployment-helpers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/holidayextras/deployment-helpers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/holidayextras/deployment-helpers/git/refs{/sha}","trees_url":"https://api.github.com/repos/holidayextras/deployment-helpers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/holidayextras/deployment-helpers/statuses/{sha}","languages_url":"https://api.github.com/repos/holidayextras/deployment-helpers/languages","stargazers_url":"https://api.github.com/repos/holidayextras/deployment-helpers/stargazers","contributors_url":"https://api.github.com/repos/holidayextras/deployment-helpers/contributors","subscribers_url":"https://api.github.com/repos/holidayextras/deployment-helpers/subscribers","subscription_url":"https://api.github.com/repos/holidayextras/deployment-helpers/subscription","commits_url":"https://api.github.com/repos/holidayextras/deployment-helpers/commits{/sha}","git_commits_url":"https://api.github.com/repos/holidayextras/deployment-helpers/git/commits{/sha}","comments_url":"https://api.github.com/repos/holidayextras/deployment-helpers/comments{/number}","issue_comment_url":"https://api.github.com/repos/holidayextras/deployment-helpers/issues/comments{/number}","contents_url":"https://api.github.com/repos/holidayextras/deployment-helpers/contents/{+path}","compare_url":"https://api.github.com/repos/holidayextras/deployment-helpers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/holidayextras/deployment-helpers/merges","archive_url":"https://api.github.com/repos/holidayextras/deployment-helpers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/holidayextras/deployment-helpers/downloads","issues_url":"https://api.github.com/repos/holidayextras/deployment-helpers/issues{/number}","pulls_url":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls{/number}","milestones_url":"https://api.github.com/repos/holidayextras/deployment-helpers/milestones{/number}","notifications_url":"https://api.github.com/repos/holidayextras/deployment-helpers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/holidayextras/deployment-helpers/labels{/name}","releases_url":"https://api.github.com/repos/holidayextras/deployment-helpers/releases{/id}","deployments_url":"https://api.github.com/repos/holidayextras/deployment-helpers/deployments","created_at":"2015-09-26T10:43:30Z","updated_at":"2016-01-21T12:48:37Z","pushed_at":"2016-05-20T11:20:36Z","git_url":"git://github.com/holidayextras/deployment-helpers.git","ssh_url":"git@github.com:holidayextras/deployment-helpers.git","clone_url":"https://github.com/holidayextras/deployment-helpers.git","svn_url":"https://github.com/holidayextras/deployment-helpers","homepage":null,"size":44,"stargazers_count":2,"watchers_count":2,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"holidayextras:master","ref":"master","sha":"af7a7310df6fc67f708f25772f7736bb118bd355","user":{"login":"holidayextras","id":286993,"avatar_url":"https://avatars.githubusercontent.com/u/286993?v=3","gravatar_id":"","url":"https://api.github.com/users/holidayextras","html_url":"https://github.com/holidayextras","followers_url":"https://api.github.com/users/holidayextras/followers","following_url":"https://api.github.com/users/holidayextras/following{/other_user}","gists_url":"https://api.github.com/users/holidayextras/gists{/gist_id}","starred_url":"https://api.github.com/users/holidayextras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holidayextras/subscriptions","organizations_url":"https://api.github.com/users/holidayextras/orgs","repos_url":"https://api.github.com/users/holidayextras/repos","events_url":"https://api.github.com/users/holidayextras/events{/privacy}","received_events_url":"https://api.github.com/users/holidayextras/received_events","type":"Organization","site_admin":false},"repo":{"id":43201844,"name":"deployment-helpers","full_name":"holidayextras/deployment-helpers","owner":{"login":"holidayextras","id":286993,"avatar_url":"https://avatars.githubusercontent.com/u/286993?v=3","gravatar_id":"","url":"https://api.github.com/users/holidayextras","html_url":"https://github.com/holidayextras","followers_url":"https://api.github.com/users/holidayextras/followers","following_url":"https://api.github.com/users/holidayextras/following{/other_user}","gists_url":"https://api.github.com/users/holidayextras/gists{/gist_id}","starred_url":"https://api.github.com/users/holidayextras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holidayextras/subscriptions","organizations_url":"https://api.github.com/users/holidayextras/orgs","repos_url":"https://api.github.com/users/holidayextras/repos","events_url":"https://api.github.com/users/holidayextras/events{/privacy}","received_events_url":"https://api.github.com/users/holidayextras/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/holidayextras/deployment-helpers","description":"A collection of scripts that can be used as part of a deployment process.","fork":false,"url":"https://api.github.com/repos/holidayextras/deployment-helpers","forks_url":"https://api.github.com/repos/holidayextras/deployment-helpers/forks","keys_url":"https://api.github.com/repos/holidayextras/deployment-helpers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/holidayextras/deployment-helpers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/holidayextras/deployment-helpers/teams","hooks_url":"https://api.github.com/repos/holidayextras/deployment-helpers/hooks","issue_events_url":"https://api.github.com/repos/holidayextras/deployment-helpers/issues/events{/number}","events_url":"https://api.github.com/repos/holidayextras/deployment-helpers/events","assignees_url":"https://api.github.com/repos/holidayextras/deployment-helpers/assignees{/user}","branches_url":"https://api.github.com/repos/holidayextras/deployment-helpers/branches{/branch}","tags_url":"https://api.github.com/repos/holidayextras/deployment-helpers/tags","blobs_url":"https://api.github.com/repos/holidayextras/deployment-helpers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/holidayextras/deployment-helpers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/holidayextras/deployment-helpers/git/refs{/sha}","trees_url":"https://api.github.com/repos/holidayextras/deployment-helpers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/holidayextras/deployment-helpers/statuses/{sha}","languages_url":"https://api.github.com/repos/holidayextras/deployment-helpers/languages","stargazers_url":"https://api.github.com/repos/holidayextras/deployment-helpers/stargazers","contributors_url":"https://api.github.com/repos/holidayextras/deployment-helpers/contributors","subscribers_url":"https://api.github.com/repos/holidayextras/deployment-helpers/subscribers","subscription_url":"https://api.github.com/repos/holidayextras/deployment-helpers/subscription","commits_url":"https://api.github.com/repos/holidayextras/deployment-helpers/commits{/sha}","git_commits_url":"https://api.github.com/repos/holidayextras/deployment-helpers/git/commits{/sha}","comments_url":"https://api.github.com/repos/holidayextras/deployment-helpers/comments{/number}","issue_comment_url":"https://api.github.com/repos/holidayextras/deployment-helpers/issues/comments{/number}","contents_url":"https://api.github.com/repos/holidayextras/deployment-helpers/contents/{+path}","compare_url":"https://api.github.com/repos/holidayextras/deployment-helpers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/holidayextras/deployment-helpers/merges","archive_url":"https://api.github.com/repos/holidayextras/deployment-helpers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/holidayextras/deployment-helpers/downloads","issues_url":"https://api.github.com/repos/holidayextras/deployment-helpers/issues{/number}","pulls_url":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls{/number}","milestones_url":"https://api.github.com/repos/holidayextras/deployment-helpers/milestones{/number}","notifications_url":"https://api.github.com/repos/holidayextras/deployment-helpers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/holidayextras/deployment-helpers/labels{/name}","releases_url":"https://api.github.com/repos/holidayextras/deployment-helpers/releases{/id}","deployments_url":"https://api.github.com/repos/holidayextras/deployment-helpers/deployments","created_at":"2015-09-26T10:43:30Z","updated_at":"2016-01-21T12:48:37Z","pushed_at":"2016-05-20T11:20:36Z","git_url":"git://github.com/holidayextras/deployment-helpers.git","ssh_url":"git@github.com:holidayextras/deployment-helpers.git","clone_url":"https://github.com/holidayextras/deployment-helpers.git","svn_url":"https://github.com/holidayextras/deployment-helpers","homepage":null,"size":44,"stargazers_count":2,"watchers_count":2,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/11"},"html":{"href":"https://github.com/holidayextras/deployment-helpers/pull/11"},"issue":{"href":"https://api.github.com/repos/holidayextras/deployment-helpers/issues/11"},"comments":{"href":"https://api.github.com/repos/holidayextras/deployment-helpers/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/holidayextras/deployment-helpers/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/holidayextras/deployment-helpers/statuses/0594a61e304b66ac0a30e44db9e13c55acd5fb43"}}}}
{"actor":{"display_login":"hx-markterry"}}