[Question] "Adding read/write deployment key" for 2.0



Here is a question about deployment key.
Does this below instruction for 1.0 also works for 2.0?


  • Create a ssh key pair by following the GitHub instructions Note: when asked “Enter passphrase (empty for no passphrase)”, do not enter a passphrase.
  • Go to https://github.com/you/test-repo/settings/keys on GitHub and click Add deploy key. Enter any title in the Title field, then copy and paste the public key you just created. Make sure to check Allow write access, then click Add key.
  • Go to https://circleci.com/gh/you/test-repo/edit#ssh on CircleCI and add the private key that you just created. Enter github.com in the Hostname field and press the submit button.

I have followed the instruction and tried out to git tags $TAG && git push --tags but it failed: https://circleci.com/gh/kenju/docker-elasticsearch-circleci/39

And if I delete the auto-generated deploy key for checking-out ( https://circleci.com/gh/#{user}/#{repo}/edit#checkout ), the primary container seems read private key and wait for “Enter passphrase” like this:


Enter passphrase for key '/root/.ssh/id_rsa': 

How to reproduce

1 Follow below instruction and set ssh key pairs in CircleCI and GitHub


2 Use the created ssh_key in Circle CI 2.0 config ( .circleci/config.yml )


It looks like you got it working. What did you change?


I removed git tag from config.yml, and currently do not use deployment key. That is why the latest build succeeded.


Can you try starting the SSH agent?




That was what I have missed.
Simply added

- add_ssh_keys

to config.yml and it solved. Thank you very much.