forked from balena-io/balena-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
44 lines (42 loc) · 1.41 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
# We want to avoid unnecessary test runs, because they load the API, so:
# - we run tests for all changes in PRs
# - we run deploys for all version-tagged commits
# - we don't want to do anything for any other cases
# Travis has a bunch of filtering that's supposed to cover this sort of thing, but
# it doesn't quite work.
language: node_js
matrix:
include:
- node_js:
- '8'
- node_js:
- '6'
env:
- 'CAN_DEPLOY=true'
before_install:
- npm -g install npm@4
script:
# Skip tests entirely, unless it's a pull request
# If we end up deploying, a deploy runs the tests anyway
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then npm run ci; fi'
notifications:
email: false
webhooks:
urls:
- https://webhooks.gitter.im/e/8b150eaf525c280ec2ac
on_success: change
on_failure: always
on_start: never
before_deploy:
- 'if [ "$CAN_DEPLOY" == "true" ]; then npm run ci; fi'
deploy:
provider: npm
email: '[email protected]'
skip_cleanup: true
api_key:
secure: SKemSDObFtG2GnVxhmxR4KMr/5S8LwlVdbgom3ouQ/kXAfMY0n6KaV6nwM+4EhW9zg6A8r2XQ6Q7fWs+ESwNvk1dS6MAHwdC5KOUpVqeRxsAuyZnIRdwa0J9wMbzt2I0E9D0sTvi4FZSO9a/6fJDWUrbTFP7Dv/S3ngyQz014ZY=
on:
# Deploys happen if there's a tag, it's a version number, and this row in the matrix has '$CAN_DEPLOY'
tags: true
condition: $CAN_DEPLOY = 'true' && $TRAVIS_TAG =~ ^v?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+
repo: resin-io/resin-sdk