Catalyze Deployment
This page documents deployments using dpl v1 which is currently the legacy version. The dpl v2 is released, and we recommend useig it. Please see our blog post for details. dpl v2 documentation can be found here.
Travis CI can automatically deploy to Catalyze after a successful build.
Before configuring your .travis.yml
you need to:
- Find your Catalyze git remote:
- Make sure your Catalyze environment is associated.
-
Get the git remote by running
git remote -v
from within the associated repository. -
Edit your
.travis.yml
:deploy: provider: catalyze target: "ssh://git@git.catalyzeapps.com:2222/app1234.git"
- Set up a deployment key to Catalyze for Travis CI:
- Install the Travis CI command line client.
-
Get the public SSH key for your Travis CI project and save it to a file by running
travis pubkey > travis.pub
-
Add the key as a deploy key using the catalyze command line client within the associated repo. For example:
catalyze deploy-keys add travisci ./travis.pub code-1
where
code-1
is the name of your service.
- Set up Catalyze as a known host for Travis CI:
- List your known hosts by running
cat ~/.ssh/known_hosts
. -
Find and copy the line from known_hosts that includes the git remote found in Step 1. It’ll look something like
[git.catalyzeapps.com]:2222 ecdsa-sha2-nistp256 BBBB12abZmKlLXNo...
-
Update your
before_deploy
step in.travis.yml
to update theknown_hosts
file:before_deploy: echo "[git.catalyzeapps.com]:2222 ecdsa-sha2-nistp256 BBBB12abZmKlLXNo..." >> ~/.ssh/known_hosts
- List your known hosts by running
Deploy a subset of your Files #
To only deploy the build
folder, for example, set skip_cleanup: true
and
path: “build”:
deploy:
provider: catalyze
target: "ssh://git@git.catalyzeapps.com:2222/app1234.git"
skip_cleanup: true
path: "build"
Run Commands Before or After Deploy #
Sometimes, you want to run commands before or after deploying. You can use
the before_deploy
and after_deploy
stages for this. These will only be
triggered if Travis CI is actually deploying.
before_deploy: "echo 'ready?'"
deploy:
..
after_deploy:
- ./after_deploy_1.sh
- ./after_deploy_2.sh