I have the following .travis.yml
:
sudo: required
language: node_js
branches:
only:
- master
before_install:
- curl https://install.meteor.com | /bin/sh
- npm install standard -g
script:
- standard
- sh run_tests.sh
- '[ "${TRAVIS_PULL_REQUEST}" != "false" ] && bash check_for_new_version_number.bash'
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && printf $LI | meteor login && meteor publish || exit 0'
If any of the build commands fail (exit code != 0) the build still is marked as a success, as the last command exists with 0. If I change the last command to exit with 1, the build does fail.
According to http://docs.travis-ci.com/user/customizing-the-build/#Customizing-the-Build-Step, this exit codes should accumulate and the build should fail if any fail. What am I missing?
Thanks!
The problem here is that Travis takes your travis.yml and basically generates a huge bash script. If you do 'exit 0' that build script is terminated and you loose track of your execution. If you want to ignore the error on the last line I suggest something like this instead:
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && printf $LI | meteor login && meteor publish || true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With