Travis

Atlas Deployment

This page documents deployments using dpl v1 which is currently the legacy version. The dpl v2 is released, and we recommend useig it. Please see our blog post for details. dpl v2 documentation can be found here.

Travis CI can automatically deploy your application to Atlas after a successful build.

Hashicorp announced that Atlas is being decommissioned by March 30, 2017. It is replaced by Terraform Enterprise.

To deploy your application to Atlas:

  1. Sign in to your Atlas account.
  2. Generate an Atlas API token for Travis CI.
  3. Add the following minimum configuration to your .travis.yml

    deploy:
      provider: atlas
      token: "YOUR ATLAS API TOKEN"
      app: "YOUR ATLAS USERNAME/YOUR ATLAS APP NAME"
    

Include or Exclude Files #

You can include and exclude files by adding the include and exclude entries to .travis.yml. Both are glob patterns of files or directories to include or exclude, and may be specified multiple times. If there is a conflict, excludes have precedence over includes.

deploy:
  provider: atlas
  exclude: "*.log"
  include:
   - "build/*"
   - "bin/*"

Use the Version Control System #

Get the lists of files to exclude and include from your version control system (Git, Mercurial or Subversion):

deploy:
  provider: atlas
  vcs: true

Other Deployment Options #

The following section lists other deployment options that are available.

Specify the Atlas Server Address #

Use the following code to specify the Atlas Server Address:

deploy:
   provider: atlas
   address: "URL OF THE ATLAS SERVER"

Add Custom Metadata #

Add one or more items of metadata:

deploy:
  provider: atlas
  metadata:
    - "custom_name=Jane"
    - "custom_surname=Doe"

Conditional Deploys #

You can deploy only when certain conditions are met. See Conditional Releases with on:.

Running commands before and after deploy #

Sometimes you want to run commands before or after deploying. You can use the before_deploy and after_deploy stages for this. These will only be triggered if Travis CI is actually deploying.

before_deploy: "echo 'ready?'"
deploy:
  ..
  after_deploy:
    - ./after_deploy_1.sh
    - ./after_deploy_2.sh