Hello,
I am trying to create a python virtual environment and install private packages with SSH protocol from requirements.txt file. Its content looks like this:
package1 @ git+ssh://git@bitbucket.org:USER/package1.git
package2 @ git+ssh://git@bitbucket.org:USER/package2.git
In the build stage I am using script task with powershell and executing command:
python -m pip install -r .\requirements.txt
This is the log that bamboo is generating:
simple 24-Jul-2024 10:40:13 Starting task 'Get dependencies' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
command 24-Jul-2024 10:40:13 Beginning to execute external process for build 'TEST - test_plan - Default Job #32 (TEST-TEST-JOB1-32)'\n ... running command line: \nC:\bamboo_agent\temp\TEST-TEST-JOB1-32-ScriptBuildTask-8492469421397391151.ps1\n ... in: C:\bamboo_agent\xml-data\build-dir\TEST-TEST-JOB1\n
build 24-Jul-2024 10:40:19 pip 24.1.2 from C:\bamboo_agent\xml-data\build-dir\TEST-TEST-JOB1\.venv\Lib\site-packages\pip (python 3.12)
build 24-Jul-2024 10:40:20 Collecting git+ssh://git@bitbucket.org:USER/package1.git (from -r .\requirements.txt (line 3))
build 24-Jul-2024 10:40:20 Cloning git+ssh://git@bitbucket.org:USER/package1.git (to revision develop) to c:\windows\temp\pip-req-build-3z8q8j72
error 24-Jul-2024 10:40:20 Running command git clone --filter=blob:none --quiet 'ssh://git@bitbucket.org:USER/package1.git' 'C:\Windows\Temp\pip-req-build-3z8q8j72'
error 24-Jul-2024 10:40:21 Host key verification failed.
error 24-Jul-2024 10:40:21 fatal: Could not read from remote repository.
error 24-Jul-2024 10:40:21
error 24-Jul-2024 10:40:21 Please make sure you have the correct access rights
error 24-Jul-2024 10:40:21 and the repository exists.
error 24-Jul-2024 10:40:21 error: subprocess-exited-with-error
error 24-Jul-2024 10:40:21
error 24-Jul-2024 10:40:21 git clone --filter=blob:none --quiet 'ssh://git@bitbucket.org:USER/package1.git' 'C:\Windows\Temp\pip-req-build-3z8q8j72' did not run successfully.
error 24-Jul-2024 10:40:21 exit code: 128
error 24-Jul-2024 10:40:21
error 24-Jul-2024 10:40:21 See above for output.
error 24-Jul-2024 10:40:21
error 24-Jul-2024 10:40:21 note: This error originates from a subprocess, and is likely not a problem with pip.
error 24-Jul-2024 10:40:21 error: subprocess-exited-with-error
error 24-Jul-2024 10:40:21
error 24-Jul-2024 10:40:21 git clone --filter=blob:none --quiet 'ssh://git@bitbucket.org:USER/package1.git' 'C:\Windows\Temp\pip-req-build-3z8q8j72' did not run successfully.
error 24-Jul-2024 10:40:21 exit code: 128
error 24-Jul-2024 10:40:21
error 24-Jul-2024 10:40:21 See above for output.
error 24-Jul-2024 10:40:21
error 24-Jul-2024 10:40:21 note: This error originates from a subprocess, and is likely not a problem with pip.
build 24-Jul-2024 10:40:21
build 24-Jul-2024 10:40:21
simple 24-Jul-2024 10:40:21 Finished task 'Get dependencies' with result: Success
My question is; How can I configure bamboo to use specific SSH key to execute this task correctly?