Issue
I am interested in the Bitbucket Pipeline and struggling with it.
If you guys have any idea, please let me know. I am really appreciated.
Below is the scenario:
- I have 2 repos: Library and Package. Library contains the source code and the Package contains specific code that would be re-used in many projects.
- Bitbucket Pipeline is enable for both Library and Package repo.
- I write the code in Library repo, build, and push the final code to Package repo. Therefore, Library and Package repos need to communicate using Bitbucket Pipeline.
Below is my questions:
- How can I use SSH Key in Bitbucket Pipeline to pull/push code from Library repo to Package repo without the permission denied?
- According to this link: the third comment from Maze Hawks, adding the SSH Key to Personal Setting allow to do it, but do we have any alternative ways so we don't have to add the SSH Key to Personal Setting?
Thank you for reading my question.
Solution
but do we have any alternative ways so we don't have to add the SSH Key to Personal Setting?
Not with SSH: you need to have the right public key associated with your account (assuming your account owns the Package repository, meaning has the right to push to it in the first place)
Or, you would need for your BitBucket pipeline to push back using alternative authentication methods, using an HTTPS URL and OAuth. (Settings > OAuth consumers > Add consumer.)
Answered By - VonC