自动授权Travis CI上的SSH身份验证请求

Sch*_*ems 16 travis-ci

我在我的构建中做了一些事情,以便在我的travis测试中获得此输出.它挂起,因为我的测试无法接受或拒绝,测试失败:

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)? 
Run Code Online (Sandbox Code Playgroud)

我和github.com有类似的问题,但我改为只读网址.而不是为每个托管git repo的x.com处理这个问题,有没有办法让travis只通过ssh自动授权任何auth请求?我可以通过以下方式在本地执行此操作:http://debuggable.com/posts/disable-strict-host-checking-for-git-clone:49896ff3-0ac0-4263-9703-1eae4834cda3是否可以设置类似特拉维斯?

Sch*_*ems 30

好吧,我想我想通了.一个选项是在before_script中将这些行添加到〜/ .ssh/config中,如下所示:

before_script:
  - echo -e "Host heroku.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
  - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
Run Code Online (Sandbox Code Playgroud)

似乎可以做到这一点.


Rus*_*lex 14

这里有新的travis内置设置

只需将其添加到您的配置中

addons:
  ssh_known_hosts:
  - git.example.com
Run Code Online (Sandbox Code Playgroud)

https://docs.travis-ci.com/user/ssh-known-hosts/