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:

  1. Find your Catalyze git remote:
    1. Make sure your Catalyze environment is associated.
    2. Get the git remote by running git remote -v from within the associated repository.

    3. Edit your .travis.yml:

      deploy:
        provider: catalyze
        target: "ssh://git@git.catalyzeapps.com:2222/app1234.git"
      
  2. Set up a deployment key to Catalyze for Travis CI:
    1. Install the Travis CI command line client.
    2. Get the public SSH key for your Travis CI project and save it to a file by running

      travis pubkey > travis.pub
      
    3. 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.

  3. Set up Catalyze as a known host for Travis CI:
    1. List your known hosts by running cat ~/.ssh/known_hosts.
    2. 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...
      
    3. Update your before_deploy step in .travis.yml to update the known_hosts file:

      before_deploy:  echo "[git.catalyzeapps.com]:2222 ecdsa-sha2-nistp256 BBBB12abZmKlLXNo..." >> ~/.ssh/known_hosts
      

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