How do I set up Travis CI to deploy to Enclave?
Deploying from Travis CI is easy on Aptible! We recommend the following approach:
- Create a “Robots” role in your Aptible organization, and grant it “Read” and “Manage” permissions on your production account.
- Invite a new deploy user to this Robots role. It needs to have a real email address, but can be something like firstname.lastname@example.org.
- Generate an SSH key pair for the deploy user (you can do this via:
ssh-keygen -f deploy.pem). Don’t set a password for the key, since that won’t work well on Travis.
- Accept the invitation for email@example.com, activate the account, and upload the public key from Step 3 on your Aptible User Settings page.
- Encrypt the private key and store it in the repo, using Travis’ instructions. We recommend the “Automated Encryption” method, using the Travis CI command line tool.
- Add a custom deploy step, following Travis’ instructions. It should look something like:
1 2 3 4 5 after_success: - chmod 600 .travis/deploy.pem - ssh-add .travis/deploy.pem - git remote add aptible firstname.lastname@example.org:$ENVIRONMENT_HANDLE/$APP_HANDLE.git - git push aptible master