How do I set up Circle CI to deploy to Enclave?
To deploy from Circle CI 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 email@example.com.
- 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 Circle CI.
- Accept the invitation for firstname.lastname@example.org, activate the account, and upload the public key from Step 3 on your Aptible User Settings page.
- Upload the private key to your project by visiting the Project Settings > SSH keys page on Circle CI.
- Add a custom deploy step, following Circle’s instructions. It should look something like:
1 2 3 4 5 deployment: production: branch: production commands: - git push email@example.com:$ENVIRONMENT_HANDLE/$APP_HANDLE.git $CIRCLE_SHA1:master