Does Travis CI support deploying to multiple environment in sequence?

In the deploy phase, we want to deploy to staging environment first, run tests and then deploy to production environment. I wonder whether this is feasible in Travis CI.

Deployments, like all other build steps, are always done in sequence, in the order they are specified in .travis.yml.

It however isn’t supported to use your own hardware as a CI environment to run tests on, you need Travis Enterprise for that.

Thanks for your response. I have a followup question: does Travis CI support a manual approval stage in the middle?

No, it doesn’t.

If you tell me what you want this for, I may be able to suggest something else to achieve what you need.

I want human to make adjustment before the new change is deployed to production.

Have the build logic recognize some kind of a flag and make the deployment conditional on that flag.

Then have the human push their manual changes and cause a build that would have that flag set.

E.g.

  • if the flag is an envvar:

    • condition:
      deploy:
        - <...>
        - on:
            condition: -n $DEPLOY
      
    • triggering a build:
      • trigger a manual build – via Web UI or API – with custom configuration:
        env:
          global:
            - DEPLOY=1
        
  • If the flag is a tag on a commit

    • condtion:
      deploy:
        <...>
        on:
          tags: true
      
    • triggering a build:
      • just push a tag
Imprint