Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto Authorize SSH Auth Requests on Travis CI

Tags:

travis-ci

I'm doing something in my build to get this output in my travis tests. It hangs since my test cannot accept or decline, and the test fails:

The authenticity of host 'heroku.com (50.19.85.154)' can't be established.
RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1blah.
Are you sure you want to continue connecting (yes/no)? 

I had a similar problem with github.com but I changed to read only urls. Instead of dealing with this problem for every x.com that hosts a git repo, is there a way to have travis just auto authorize any auth request via ssh that is made? I can do this locally via something like this: http://debuggable.com/posts/disable-strict-host-checking-for-git-clone:49896ff3-0ac0-4263-9703-1eae4834cda3 is it possible to set something like that up on Travis?

like image 870
Schneems Avatar asked May 19 '13 19:05

Schneems


1 Answers

Ok, think i figured it out. One option is to add those lines to your ~/.ssh/config in a before_script like this:

before_script:
  - echo -e "Host heroku.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
  - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config

Seems to do the trick.

like image 126
Schneems Avatar answered Dec 08 '22 04:12

Schneems