Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

Commit

Permalink
Merge pull request #624 from jdalton/readme
Browse files Browse the repository at this point in the history
Add readme note for CI caching.
  • Loading branch information
nicks authored Sep 27, 2016
2 parents ae83e7a + d8ebc23 commit 3d44598
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,32 @@ Pre-2.0, this package was published to NPM as [phantomjs](https://www.npmjs.com/
We changed the name to [phantomjs-prebuilt](https://www.npmjs.com/package/phantomjs-prebuilt) at
the request of PhantomJS team.

Continuous Integration
----------------------

Please **do not** download PhantomJS for every CI job because it can quickly
overload our CDNs. Instead take advantage of CI caching.

In [Travis-CI](https://travis-ci.org/) add the following to your `.travis.yml`
to [enable caching](https://docs.travis-ci.com/user/caching/) & avoid repeated
downloads of PhantomJS.

#### .travis.yml
```yml
cache:
directories:
- travis_phantomjs

before_install:
# Upgrade PhantomJS to v2.1.1.
- "export PHANTOMJS_VERSION=2.1.1"
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
- "phantomjs --version"
```
Deciding Where To Get PhantomJS
-------------------------------
Expand Down

0 comments on commit 3d44598

Please sign in to comment.