Open flofriday opened 6 years ago
I had to type travis encrypt bd2XXXXXX46f --pro
(bd2XXXXXX46f is my github token).
Originally travis was split in travis-ci.org for opensource and travis-ci.com for paid private project. However in may 2018 they decided to move to travis.com only. So when I signed up to travis I got an travis-ci.com account, but the commandline tool https://github.com/travis-ci/travis.rb was last updated in march and so it doesn't know that the two domains are now united.
Therefore, the tool assumed that my opensource project is on .org which is wrong and with travis encrypt --pro
you can force the .com domain.
However, I am not sure if this is the reason it didn't worked, it is just the only explanation I can think of. Please correct me if I am wrong.
Maybe it would be a good idea to add to .travis.yml
something like:
deploy:
# TODO update `api_key.secure`
# - Create a `public_repo` GitHub token. Go to: https://github.com/settings/tokens/new
# - Encrypt it: `travis encrypt 0123456789012345678901234567890123456789`
# Note: If your project is on travis-ci.com you need to add the --pro flag like so:
# `travis encrypt 0123456789012345678901234567890123456789 --pro`
# - Paste the output down here
api_key:
@flofriday Thanks! It solved my issue, too. This could be added to the documentation of travis-ci
or to StackOverflow
for future reference.
Now I understand it. We should choose --org
or --pro
(travis.com) at first. Based on the full conversion from org
to com
, so I used --pro
. I manually turned off the services of org
, then the releases never result in a bad credential now.
Yeah the option with --pro solves it.
I will write a PR to make the documation more clearly about this difference.
@flofriday Maybe this doc would help a little. Seemingly there will be a full transit from org
to pro
.
I created the PR #105, and I will leave this issue open for now until the problem is fixed, so future users can find the solution faster.
@psychelzh yes if found the document helped once I found out that --pro
fixed my problem, but until that moment it wasn't clear to me that my problem and the transit where connected.
As the doc points out the decision for the transit took place on May 2nd, 2018 however the CLI travis tool was last updated on February 12, 2018 (as you can see here. So the tool just doesn't know about this move to travis-ci.com. Personally I really hope that they will update their tool so it can auto-detect between .com and .org.
I don't like writing an issue here and bore you but I spend the whole day with 22 releases and everyone failed. I simply don't know what to do at this point.
What I did
travis encrypt bd2XXXXXXX46f
-> travis fails everytime at deployment withGET https://api.github.com/user: 401 - Bad credentials
https://travis-ci.com/flofriday/thumbcloud/jobs/128447592I also tried:
travis encrypt bd2XXXXXXX46f -r flofriday/thumbcloud
travis encrypt -r flofriday/thumbcloud -org
like recommended here: https://github.com/travis-ci/travis-ci/issues/8128 which gives a prompt to enter the key, however exiting with CTRL - D didn't worked on my windows machine"
travis encrypt bd2XXXXXXX46f --add
travis encrypt bd2XXXXXXX46f --add deploy.api_key