Description
We need to send email (with custom email) from travis to specified users when the build fails.
- NOTE: As of now, Travis-ci does not allow custom messages for email notification.
End Goal
notifications:
email:
on_success: never
on_failure: always
recipients:
- email1@domain.com
- email2@domain.com
Step by step
- Specify when to send email - only when build/test failed
on_success: never # do not send anything if build succeeds
on_failure: always # if there is a fail
# other options are [always|never|change]
- Specify email addresses
recipients:
- email1@domain.com
- email2@domain.com
- Complete travis config file
---
language: node_js
node_js:
- "4.5.0"
sudo: false
notifications:
email:
on_success: change # only if status change from fail to success
on_failure: always # if there is a fail
recipients:
- email1@domain.com
- email2@domain.com
cache:
directories:
- node_modules
before_install:
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
- "npm config set spin false"
- "npm install -g npm@^2"
install:
- npm install -g bower
- npm install
- bower install
script:
- ember test
before_deploy:
- ember test -f 'Acceptance |'
deploy:
skip_cleanup: true
provider: script
script: ember deploy testing --verbose
on:
branch: deployment
Now you can do this!