سؤال

I'm trying to configure CoinsManager so that the alpha version gets auto-deployed after Travis Continuous Integration.

Here is our .travis.yml file:

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

The problem is Travis reporting the following error:

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

But I did exactly like the doc recommended

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

I also tried slighly different cases (with or without dash an double quotes), as suggested in that Github issue.

I'm not sure where the problem comes from: Travis? Heroku?

هل كانت مفيدة؟

المحلول

I solved my problem.

We have the upstream repo at CoinsManager/CoinsManager, which I forked at Fandekasp/CoinsManager. And when running travis encrypt, travis is getting the repo name from my origin remote, instead of querying the heroku git repo.

Therefore, I needed to specify the correct repo as follow:

$ travis encrypt -r CoinsManager/CoinsManager $(heroku auth:token) --add deploy.api_key
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top