Travis CI

Once you've completed the steps for CI Integration, you can set up Travis CI as follows:

First, encrypt the private key you created for the robot user and store it in the repo. To do so, Travis CI's instructions on encrypting files. We recommend using the "Automated Encryption" method.

Then, add an after_success deploy step. Here again, follow Travis CI's instructions on custom deployment. The after_success in your .travis.yml file should look like this:

  - git fetch --depth=1000000
  - chmod 600 .travis/deploy.pem
  - ssh-add .travis/deploy.pem
  - git remote add aptible [email protected]:$ENVIRONMENT_HANDLE/$APP_HANDLE.git
  - git push aptible master



In the above example, [email protected]:$ENVIRONMENT_HANDLE/$APP_HANDLE.git represents your App's Git Remote.

Also, see My deploy failed with a git error referencing objects, trees, revisions or commits to understand why you need git fetch here.

Did this page help you?