Conversation
emk
left a comment
There was a problem hiding this comment.
Thank you for the PR! I'd definitely be interested in merging this with one small change.
| exit 1 | ||
| fi | ||
|
|
||
| eval "$(ssh-agent -s)" && ssh-add |
There was a problem hiding this comment.
This looks great! Could you add a small comment here explaining why we need to do this?
There was a problem hiding this comment.
This PR makes the buildpack to be able to work in combination with https://github.com/jacobdr/ssh-private-key-buildpack. Basically, when you want to talk to a private repo, you export an SSH_KEY env var and the ssh-private-key-buildpack, will make sure it's written under .ssh/ folder.
Then this line of this buildpack will make sure to start ssh-agent -s for that specifically shell and also make sure to add any existing ssh keys (by running ssh-add) to the ssh agent run by this shell.
There was a problem hiding this comment.
Thank you! If you have a chance, could you please include a version of this comment in the code, so future maintainers know why the code is there, and users can understand how to use it? Thank you very much for figuring this out!
This is required if you have private repos in github, otherwise Cargo can't access them. The idea is to export a machine (Github user) ssh key as env var on Heroku. This is not related to Heroku but with cargo itself, how it handles ssh keys. It was first noted by @dignifiedquire in #39