-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy path.travis.yml
52 lines (45 loc) · 1.91 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
language: node_js
node_js:
- "0.10"
- "0.8"
env:
global:
- secure: bKjyTiUGN568Ryr+JIqs2DxBnSE9EKQlf09wHAlbeonTQYm5u7PfkBryizddquJX3lXTfiIdXcsMM17Gr9osHSN3SQxCTYnJgHOZ+4eUmx62nv9G/I1Xt2DpR4vtfIcMjJ3cfbpHDgP6dwB3qysv5JDSb6Xhn++vt7O1ekTJhOE=
- secure: hh5aZtl3nrDiS7tTk6PgZtAc4p3/48j6Ob3O/dhfxyMHXD8JmmU7UxiAs3RucPrcANw9tsLnqB9Z2ETTax9G7Gkiii6UmG8+V6+KTWYWouG4deLFn+2kUc14f3MtJOnuEVwfwfRFUAM6P03PoWTxoOzFxkRefO8kY9wXdQfGmMc=
before_install:
# get commit message
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
# put local node-pre-gyp on PATH
- export PATH=./node_modules/.bin/:$PATH
# put global node-gyp on PATH
- npm install node-gyp -g
# install aws-sdk so it is available for publishing
- npm install aws-sdk
# figure out if we should publish
- PUBLISH_BINARY=false
# if we are building a tag then publish
- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=true; fi;
# or if we put [publish binary] in the commit message
- if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH_BINARY=true; fi;
install:
# ensure source install works
- npm install --build-from-source
# test our module
- node index.js
before_script:
# if publishing, do it
- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp package publish; fi;
# cleanup
- node-pre-gyp clean
- node-gyp clean
script:
# if publishing, test installing from remote
- INSTALL_RESULT=0
- if [[ $PUBLISH_BINARY == true ]]; then INSTALL_RESULT=$(npm install --fallback-to-build=false > /dev/null)$? || true; fi;
# if install returned non zero (errored) then we first unpublish and then call false so travis will bail at this line
- if [[ $INSTALL_RESULT != 0 ]]; then echo "returned $INSTALL_RESULT";node-pre-gyp unpublish;false; fi
# If success then we arrive here so lets clean up
- node-pre-gyp clean
after_success:
# if success then query and display all published binaries
- node-pre-gyp info