Launchpad 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 get Launchpad to automatically import your code from GitHub after a successful build, which is useful if you are building and hosting Debian packages.

To automatically trigger an import:

  • Register a project on Launchpad and then import your GitHub project there.
  • Generate an API access token that we can use to trigger a new code import. Please make sure that the oauth_consumer_key is set to Travis Deploy.

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

  provider: launchpad

  edge: true # opt in to dpl v2

The slug contains user or team name, project name, and branch name, and is formatted like ~user-name/project-name/branch-name. If your project’s code is a git repository, the form is ~user-name/project-name/+git/repository-name. You can find your project’s slug in the header (and the url) of its page.

Status #

Support for deployments to Launchpad is in alpha. Please see Maturity Levels for details.

Known options #

Use the following options to further configure the deployment.

oauth_token Launchpad OAuth token — secret, type: string
oauth_token_secret Launchpad OAuth token secret — secret, type: string
slug Launchpad project slug — type: string, format: /^~[^\/]+\/[^\/]+\/[^\/]+$/, e.g.: ~user-name/project-name/branch-name

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 LAUNCHPAD_.

For example, oauth_token can be given as LAUNCHPAD_OAUTH_TOKEN=<oauth_token>.

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 LAUNCHPAD_OAUTH_TOKEN <oauth_token>

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

travis encrypt <oauth_token>

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.oauth_token <oauth_token>

Pull Requests #

Note that pull request builds skip the deployment step altogether.

See also #