Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support cargo ssh keys #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ EOF
exit 1
fi

eval "$(ssh-agent -s)" && ssh-add
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Could you add a small comment here explaining why we need to do this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!


# Record our Rust build environment configuration in an export file, in
# case another buildpack needs it to build Ruby gems that use Rust or
# something like that.
Expand Down