加密密钥未经授权连续部署Travis→Heroku

时间:2014-02-24 03:12:06

标签: heroku meteor travis-ci

我正在尝试配置CoinsManager,以便在Travis持续集成后自动部署the alpha version

这是我们的 .travis.yml 文件:

language: node_js
node_js:
- '0.10'
before_install:
- make install
services:
- mongodb
deploy:
  provider: heroku
  app: coinsmanager
  api_key:
    secure: "FjcbJdgcB1IIug3Qf5oFlF5PHW8LYnIUJCSUEz7GI5i6tVvtye1UvqkA12BP+//u3rtPcO3d33rjNY5/qvIRIdJ/wMKACAHdzRa8jWge2dxW7filynF6LVsh5ezwr7Sq/MgNwvqQcRp7eQNsOlBzdZRyQYE0VAa4fAD1+SZPnWQ="
  on:
    all_branches: true
after_deploy:
- "cd app/client/compass && compass compile && cd -"
- "cd app/ && meteor reset"
- restart

问题是Travis报告the following error

Expected(200) <=> Actual(401 Unauthorized)
body: "{\"id\":\"unauthorized\",\"error\":\"Invalid credentials provided.\"}" (wrong API key?)
failed to deploy

但我确实喜欢the doc推荐

$ travis encrypt $(heroku auth:token) --add deploy.api_key

我还尝试了一些略有不同的案例(有或没有双引号),如建议in that Github issue

我不确定问题出在哪里:特拉维斯? Heroku的?

1 个答案:

答案 0 :(得分:6)

我解决了我的问题。

我们在 CoinsManager / CoinsManager 上有上游回购,我在 Fandekasp / CoinsManager 分叉。当运行travis encrypt时,travis从我的原始远程获取repo名称,而不是查询heroku git repo。

因此,我需要指定正确的回购:

$ travis encrypt -r CoinsManager/CoinsManager $(heroku auth:token) --add deploy.api_key