Aptible deploy docker image from CI


#1

So I’ve set up my circle ci to build and test my applications docker image. I would like CI to be able to directly deploy my tested image to aptible with the new aptible cli deployment feature. Is there a way to authorize CI to use aptible deploy without requiring an interactive login?


#2

You’ll need to log in using the CLI to be able to call aptible deploy. The CLI supports non-interactive usage for aptible login, which is what you’ll need to use here: https://www.aptible.com/documentation/enclave/cli/login.html

We recommend creating a separate user in Aptible for your CI platform.


#3

@thomas So would you need to disable 2FA for this CI account?

I tried using the toolbelt somewhere I wasn’t logged in and saw a message about using an environment variable instead of logging in. I can’t find any docs on that so would appreciate any info you could share.


#4

@rob :

  • Indeed, you’d have to disable 2FA on the robot account
  • There is indeed an environment variable called APTIBLE_ACCESS_TOKEN that can be used to provide the CLI with an access token, but that wouldn’t be useful in your scenario: you need to login to generate the access token in the first place.