Rackspace Cloud Files 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 Rackspace Cloud Files after a successful build.
For a minimal configuration, add the following to your .travis.yml
:
deploy:
provider: cloudfiles
username: <username>
api_key: <encrypted api_key>
region: <region>
container: <container>
edge: true # opt in to dpl v2
Status #
Support for deployments to Cloud Files is in alpha. Please see Maturity Levels for details.
Known options #
Use the following options to further configure the deployment.
username |
Rackspace username — required, type: string |
api_key |
Rackspace API key — required, secret, type: string |
region |
Cloudfiles region — required, type: string, known values: ord , dfw , syd , iad , hkg |
container |
Name of the container that files will be uploaded to — required, type: string |
glob |
Paths to upload — type: string, default: **/* |
dot_match |
Upload hidden files starting a dot — 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 CLOUDFILES_
.
For example, api_key
can be given as CLOUDFILES_API_KEY=<api_key>
.
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 CLOUDFILES_API_KEY <api_key>
In order to encrypt option values when adding them to your .travis.yml
file
use travis encrypt
:
travis encrypt <api_key>
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.api_key <api_key>
Specifying files to upload #
Often, you don’t want to upload your entire project to Cloud Files.
You can specify a glob to only include specific directories or files to the upload:
deploy:
provider: cloudfiles
# ⋮
glob: build/*
By default, filenames starting with a dot are excluded. Add the option
dot_match
to make your glob
match these, too:
deploy:
provider: cloudfiles
# ⋮
glob: build/*
dot_match: true
Deploying to multiple regions or containers: #
If you want to upload to multiple regions or containers, you can do this:
deploy:
- provider: cloudfiles
# ⋮
region: <region-1>
container: <container-1>
- provider: cloudfiles
# ⋮
region: <region-2>
container: <container-2>
Pull Requests #
Note that pull request builds skip the deployment step altogether.