|
1 | 1 | #!/bin/bash |
2 | | -# Install a custom version of PhantomJS, http://phantomjs.org/ |
| 2 | +# Install a custom PhantomJS version - https://phantomjs.org/ |
3 | 3 | # |
4 | | -# If you run into any rate limiting issues from bitbucket, put the download |
5 | | -# file(s) into your own server and point to the location via the PHANTOMJS_HOST |
6 | | -# environment variable. |
| 4 | +# To run this script in Codeship, add the following |
| 5 | +# command to your project's test setup command: |
| 6 | +# \curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/phantomjs.sh | bash -s |
7 | 7 | # |
8 | 8 | # Add at least the following environment variables to your project configuration |
9 | 9 | # (otherwise the defaults below will be used). |
10 | 10 | # * PHANTOMJS_VERSION - Specify the version of PhantomJS |
11 | 11 | # * PHANTOMJS_HOST - Optional, specify the download location for the archive |
12 | 12 | # |
13 | | -# For versions 1.9.7, 1.9.8 and 2.1.1 you can also use a Codeship provided mirror |
14 | | -# by setting the PHANTOMJS_HOST variable to https://s3.amazonaws.com/codeship-packages |
15 | | -# |
16 | | -# export PHANTOMJS_HOST="https://s3.amazonaws.com/codeship-packages" |
| 13 | +# If you run into any rate limiting issues from Bitbucket, put the download |
| 14 | +# file(s) into your own server and point to the location via the PHANTOMJS_HOST |
| 15 | +# environment variable. |
17 | 16 | # |
18 | | -# Include in your builds via |
19 | | -# \curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/phantomjs.sh | bash -s |
20 | | -PHANTOMJS_VERSION=${PHANTOMJS_VERSION:="1.9.8"} |
| 17 | +PHANTOMJS_VERSION=${PHANTOMJS_VERSION:="2.1.1"} |
21 | 18 | PHANTOMJS_HOST=${PHANTOMJS_HOST:="https://bitbucket.org/ariya/phantomjs/downloads"} |
22 | 19 |
|
| 20 | +if [[ "${PHANTOMJS_HOST}" == "https://s3.amazonaws.com/codeship-packages" ]]; |
| 21 | +then |
| 22 | + echo "The Codeship mirror is no longer available, please use an alternative location" |
| 23 | + echo "PhantomJS 2.1.1 is installed by default" |
| 24 | + exit 1 |
| 25 | +fi |
| 26 | + |
23 | 27 | set -e |
24 | 28 | CACHED_DOWNLOAD="${HOME}/cache/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2" |
25 | 29 |
|
26 | | -# clean old version and setup directories |
| 30 | +# Remove old version and setup directories |
27 | 31 | rm -rf ~/.phantomjs |
28 | 32 | mkdir ~/.phantomjs |
29 | 33 | wget --continue --output-document "${CACHED_DOWNLOAD}" "${PHANTOMJS_HOST}/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2" |
|
0 commit comments