Travis-ci.org - build cannot clone private Bitbucket repository

My build is failing at composer install due to an interactive connection request that I can’t respond to:

https://travis-ci.org/github/dotherightthing/wpdtrt-npm-scripts/builds/674301179

I had a look on Travis docs, and it looks like I might need a repo key, but the page doesn’t provide any information on how to set this up: https://docs.travis-ci.com/user/private-dependencies-bb/#repo-key

Alternatively, I might need to add a ssh_known_hosts key to my Travis build config, but I’m unsure of exactly how I should identify Bitbucket here (I’m assuming that an IP address is risky as it could change)?

Or perhaps I should do this at Bitbucket’s end - https://confluence.atlassian.com/bitbucket/use-deployment-keys-294486051.html - but I’m not sure where I should add an SSH key in my free travis-ci.org account?

  - Installing dotherightthing/wpdtrt-dbth (dev-development a2246ad): The authenticity of host 'bitbucket.org (18.205.93.2)' can't be established.
RSA key fingerprint is SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A.
Are you sure you want to continue connecting (yes/no)? Cloning a2246ad14f
The authenticity of host 'bitbucket.org (18.205.93.0)' can't be established.
RSA key fingerprint is SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A.
Are you sure you want to continue connecting (yes/no)? 
                                                                               
  [Symfony\Component\Process\Exception\ProcessTimedOutException]               
  The process "git clone --no-checkout 'git@bitbucket.org:dotherightthing/wpd  
  trt-dbth.git' '/home/travis/build/dotherightthing/wpdtrt-npm-scripts/vendor  
  /dotherightthing/wpdtrt-dbth' && cd '/home/travis/build/dotherightthing/wpd  
  trt-npm-scripts/vendor/dotherightthing/wpdtrt-dbth' && git remote add compo  
  ser 'git@bitbucket.org:dotherightthing/wpdtrt-dbth.git' && git fetch compos  
  er" exceeded the timeout of 300 seconds.                                     
                                                                               
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received
The build has been terminated

Actually, I’ve just learned that Github now supports free private repos, so I’m going to move this repo across to the good side :slight_smile:

Oh wait, travis-ci.com costs NZD $100 a month… :frowning:

By its SSH key, naturally.

Since ~/.ssh/known_hosts is not among the files that are restored from your repo, you’ll need to add a corresponding entry dynamically in the build script.