Engine Yard Deployment
This page documents deployments using the dpl v2. Please see our blog post for details. You can check previous dpl v1 documentation here.
Travis CI can automatically deploy your Engine Yard application after a successful build.
For a minimal configuration, add the following to your .travis.yml
:
deploy:
provider: engineyard
api_key: <encrypted api_key>
edge: true # opt in to dpl v2
Alternatively, you can use email
and password
:
deploy:
provider: engineyard
email: <email>
password: <encrypted password>
The Engine Yard API token can be obtained here.
Status #
Support for deployments to Engineyard is in alpha. Please see Maturity Levels for details.
Known options #
Use the following options to further configure the deployment. Either api_key
or email
and password
are required.
api_key |
Engine Yard API key — secret, type: string, note: can be obtained at https://cloud.engineyard.com/cli |
email |
Engine Yard account email — type: string |
password |
Engine Yard password — secret, type: string |
app |
Engine Yard application name — type: string, default: repo name |
env |
Engine Yard application environment — type: string, alias: environment |
migrate |
Engine Yard migration commands — type: string |
account |
Engine Yard account name — type: string |
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 ENGINEYARD_
or EY_
.
For example, api_key
can be given as
ENGINEYARD_API_KEY=<api_key>
orEY_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 ENGINEYARD_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>
Application or Environment to deploy #
By default, the application name will be inferred from your repository name.
You can explicitly set the name via the app option:
deploy:
provider: engineyard
# ⋮
app: <app-name>
Deploying branches to different apps or environments #
In order to choose apps or environments based on the current branch use separate deploy configurations:
deploy:
- provider: engineyard
# ⋮
env: production
on:
branch: master
- provider: engineyard
# ⋮
env: staging
on:
branch: staging
Or using YAML references:
deploy:
- &deploy
provider: engineyard
# ⋮
env: production
on:
branch: master
- <<: *deploy
env: staging
on:
branch: staging
Running migrations #
You can trigger migrations by using the migrate option:
deploy:
provider: engineyard
# ⋮
migrate: rake db:migrate
Pull Requests #
Note that pull request builds skip the deployment step altogether.