Script Deployment
This page documents deployments using the dpl v2. Please see our blog post for details. You can check previous dpl v1 documentation here.
If your deployment needs more customization than the after_success
method allows,
use a custom script.
The following example runs scripts/deploy.sh
on the develop
branch of your repository if the build is successful.
If you need to run multiple commands, write an executable wrapper script that runs them all. The argument to script:
in the script deployment provider needs to be a single command.
If the script returns a nonzero status, deployment is considered a failure, and the build will be marked as “errored”.
Pass Arguments to the Script #
It is possible to pass arguments to a script deployment.
The script has access to all the usual environment variables.
Ruby version #
To ensure that deployments run consistently, we use the version of Ruby that is pre-installed on all of our build images, which may change when images are updated.
- The
travis_internal_ruby
function prints the exact pre-installed Ruby version
If you need to run a command that requires a different Ruby version than the pre-installed default, you need to set it explicitly:
Pull Requests #
Note that pull request builds skip the deployment step altogether.