greenkeeper-shrinkwrap
Enabling shrinkwrap support for Greenkeeper via Travis CI


Setup
After enabling Greenkeeper for your repository you can use this package to make it work with shrinkwrapped projects.
before_install:
- npm install -g npm
- Install
greenkeeper-shrinkwrap as well.
before_install:
- npm install -g npm
- npm install -g greenkeeper-shrinkwrap@1
- Configure Travis CI to run
greenkeeper-shrinkwrap-update right before it executes your tests.
before_script: greenkeeper-shrinkwrap-update
- Configure Travis CI to run
greenkeeper-shrinkwrap-upload right after it executed your tests.
after_script: greenkeeper-shrinkwrap-upload
Testing multiple node versions
It is common to test multiple node versions and therefor have multiple test jobs for one build. In this case the shrinkwrap will automatically be updated for every job, but only uploaded for the first one.
node_js:
- 6
- 4
before_install:
- npm install -g npm
- npm install -g greenkeeper-shrinkwrap@1
before_script: greenkeeper-shrinkwrap-update
after_script: greenkeeper-shrinkwrap-upload
How does it work
- This script detects whether it's running on a Greenkeeper created branch
- If so it updates the shrinkwrap file with the latest version of the updated dependency
- It pushes the commit with the updated shrinkwrap file back to the Greenkeeper branch/pull request