Build Stages: Defining steps using YAML aliases

This example has 3 build stages:

  • Two jobs that run tests against Ruby 2.2 and 2.3
  • One job that deploys to staging
  • Three jobs that runs test against staging

Here’s what the .travis.yml config could look like:

  - 2.2
  - 2.3

script: bundle exec rspec

    - stage: deploy to staging
      rvm: 2.3
      install: skip # bundle install is not required
      script: ./
    - &test-staging
      stage: test staging
      rvm: 2.3
      install: skip
      script: ./ one
    - <<: *test-staging
      script: ./ two
    - <<: *test-staging
      script: ./ three

This is how the build matrix might look:


You can find the code for this example on our demo repository: