Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a single deploy when Travis builds succeeds?

I am running Travis CI using matrix of Python versions but I do want to execute the release actions only after all of these are passed, obviously.

How can I do this? It seems that the "deploy" actions are executed for each sub-build.

like image 723
sorin Avatar asked Jan 08 '15 14:01

sorin


2 Answers

It seems that this is not currently possible and there is a bug tracking it at: https://github.com/travis-ci/travis-ci/issues/929

Update

Travis disables commenting on that issue which is really a bad thing. I guess you only option now is to tweet them to reopen it. Use social pressure, works against closed business models! ;)

Also if you happen to know some competitors that do allow this, mention them! ... in the same tweet.

like image 128
sorin Avatar answered Oct 09 '22 02:10

sorin


It is possible by using bash and Travis built-in variables. For a JavaScript / Node repo that would be:

dist: trusty
language: node_js
node_js:
  - '8'
  - '7'
install: ...
script: ...
after_success:
  - 'if [ "${TRAVIS_NODE_VERSION}" = "8" ]; then cat ./coverage/lcov.info | coveralls ; fi'
  - 'if [ "${TRAVIS_NODE_VERSION}" = "8" ]; then firebase deploy --token $FIREBASE_TOKEN --non-interactive ; fi'

Other built-in variables:

  • TRAVIS_DART_VERSION
  • TRAVIS_GO_VERSION
  • TRAVIS_HAXE_VERSION
  • TRAVIS_JDK_VERSION
  • TRAVIS_JULIA_VERSION
  • TRAVIS_NODE_VERSION
  • TRAVIS_OTP_RELEASE
  • TRAVIS_PERL_VERSION
  • TRAVIS_PHP_VERSION
  • TRAVIS_PYTHON_VERSION
  • TRAVIS_R_VERSION
  • TRAVIS_RUBY_VERSION
  • TRAVIS_RUST_VERSION
  • TRAVIS_SCALA_VERSION

See https://docs.travis-ci.com/user/environment-variables/


Credits to @airbnb/enzyme which is where I took the idea from.

like image 32
zurfyx Avatar answered Oct 09 '22 00:10

zurfyx