Skip to content

Commit

Permalink
fix(readme): correct installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
boennemann committed Feb 17, 2017
1 parent b5c27b9 commit f2a2b01
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,26 @@ After [enabling Greenkeeper for your repository](https://github.com/greenkeeperi

1. [Create a GitHub access token with push access to your repository](https://github.com/settings/tokens) and make it available to Travis CI's environment as `GH_TOKEN`.

1. Configure Travis CI to run `greenkeeper-shrinkwrap-update` right before it `npm install`s your dependencies.
1. Configure Travis CI to use the npm version you want your shrinkwrap files to be generated with before it `npm install`s your dependencies.

```yml
before_install:
# It is advisable to use latest npm, as there are a lot of shrinkwrap fixes in there
- npm install -g npm
```
1. Install `greenkeeper-shrinkwrap` as well.

```yml
before_install:
# Note that this plugin uses the installed npm's built-in mechanism to update the shrinkwrap
# Therefor it is advisable to use latest npm, as there are quite some shrinkwrap fixes in there
- npm install -g npm
- npm install -g greenkeeper-shrinkwrap@1
- greenkeeper-shrinkwrap-update
```

1. Configure Travis CI to run `greenkeeper-shrinkwrap-update` right before it executes your tests.

```yml
before_script: greenkeeper-shrinkwrap-update
```

1. Configure Travis CI to run `greenkeeper-shrinkwrap-upload` right after it executed your tests.
Expand All @@ -34,8 +45,6 @@ After [enabling Greenkeeper for your repository](https://github.com/greenkeeperi
after_script: greenkeeper-shrinkwrap-upload
```

That's it.

### 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.
Expand All @@ -47,7 +56,7 @@ node_js:
before_install:
- npm install -g npm
- npm install -g greenkeeper-shrinkwrap@1
- greenkeeper-shrinkwrap-update
before_script: greenkeeper-shrinkwrap-update
# Only the node version 6 job will upload the shrinkwrap
after_script: greenkeeper-shrinkwrap-upload
```
Expand Down

0 comments on commit f2a2b01

Please sign in to comment.