- install: install any dependencies required.
- script: run the build script.
- deploy (optional): deploy application (deployment steps can’t be overridden, but is defined by using one of supported continuous deployment providers, e.g. Heroku).
You can perform additional steps when your build succeeds or fails using the after_success
(such as building documentation, or deploying to a custom server) or after_failure
(such as uploading log files) options.
before_install
(install required build tools usingsudo apt-get
,npm install -g
, etc)install
(default command for node_js:npm install
)before_script
script
(default command for node_js:npm test
)after_success
andafter_failure
before_deploy
deploy
after_deploy
after_script
Other available steps:
- install
apt addons
- install
cache components
before_cache
See here for more info.
branches:
except:
- legacy
- experimental
branches:
only:
- master
- /^feature-.*$/
Will also build pull requests to these branches.
- Defining public variables in .travis.yml
env:
- DB=mysql
- TIMEOUT=2000
-
Defining Variables in Repository Settings (go to travis-ci.org, navigate to the repository, choose “Settings” from the menu, and click on “Add new variable”).
-
Default Environment Variables (
CI=true
,TRAVIS_BRANCH
, etc) -
Convenience Variables (
TRAVIS_SECURE_ENV_VARS
,TRAVIS_PULL_REQUEST
)