Cloud Foundry Deployment

This page documents deployments using the next major version dpl v2, which currently is in a beta release phase. Please see our blog post for details. The current default version is dpl v1. Check dpl v1 documentation here.

Be sure to read the v2 deployment overview.

Travis CI can automatically upload your build to Cloud Foundry after a successful build.

For a minimal configuration, add the following to your .travis.yml:

  provider: cloudfoundry
  username: <username>
  password: <encrypted password>
  organization: <organization>
  space: <space>
  edge: true # opt in to dpl v2

Status #

Support for deployments to Cloud Foundry is *stable**.

Known options #

Use the following options to further configure the deployment.

username Cloud Foundry username — required, type: string
password Cloud Foundry password — required, secret, type: string
organization Cloud Foundry organization — required, type: string
space Cloud Foundry space — required, type: string
api Cloud Foundry api URL — type: string, default:
app_name Application name — type: string
buildpack Buildpack name or Git URL — type: string
manifest Path to the manifest — type: string
skip_ssl_validation Skip SSL validation — type: boolean
deployment_strategy Deployment strategy, either rolling or null — type: string
v3 Use the v3 API version to push the application — type: boolean

Shared options #

cleanup Clean up build artifacts from the Git working directory before the deployment — type: boolean
run Commands to execute after the deployment finished successfully — type: string or array of strings

Environment variables #

All options can be given as environment variables if prefixed with CLOUDFOUNDRY_.

For example, password can be given as CLOUDFOUNDRY_PASSWORD=<password>.

Securing secrets #

Secret option values should be given as either encrypted strings in your build configuration (.travis.yml file) or environment variables in your repository settings.

Environment variables can be set on the settings page of your repository, or using travis env set:

travis env set CLOUDFOUNDRY_PASSWORD <password>

In order to encrypt option values when adding them to your .travis.yml file use travis encrypt:

travis encrypt <password>

Or use --add to directly add it to your .travis.yml file. Note that this command has to be run in your repository’s root directory:

travis encrypt --add deploy.password <password>

Pull Requests #

Note that pull request builds skip the deployment step altogether.

See also #