Hi Raul,
I have managed to successfully use BuildKit but I have found to my dismay that on Runners (at least the Linux Runner) the SSH key is not present in /opt/atlassian/pipelines/agent/ssh/id_rsa but instead it's in the following directory:
/tmp/{runner-uuid}/ssh/id_rsa
This is problematic as the pipeline could run on any runner so UUID will change, and in addition the runner UUID is not exposed as an environment variable during the build process. As highlighted by Patrick Mead in an earlier comment, the only way currently to discover where the key is is to run something like this:
$(head -1 ~/.ssh/config | cut -f2 -d " ") # This isn't ideal as it depends heavily on how bitbucket sets the ssh config, if it changes builds will stop working
Which is a fairly brittle method.
Would it be possible to do either of the following:
- symlink /tmp/{runner-uuid}/ssh/ directory during the build setup to /opt/atlassian/pipelines/agent/ssh/ if it detects it's on a runner?
- provide SSH directory as an environment variable during the build?
- provide runner UUID, as an environment variable during the build?
Hi 257cb8fcc776 ,
As discussed in the comment, we have released a variable BITBUCKET_SSH_KEY_FILE to the provide the path to the ssh private key file.
Please refer our documentation for more details.
Regards,
Jayant