I'm trying to login to an own hosted Travis Enterprise, but usual travis login and travis login --pro are trying to login to usual Travis SAAS environment
3 Answers
Given that your Travis is hosted at travis.fewlaps.com, run
travis login -I -t your-travis-token -e https://travis.fewlaps.com/api --github-token=personal-access-token-from-githubenterprise &&
travis endpoint --set-default -e https://travis.fewlaps.com/api
...and then, to use your own Travis instead of the common one at every travis command,
travis endpoint --set-default -e https://travis.fewlaps.com/api
Remember that Travis will need that your GitHub Enterpise has the needed permissons. Right now, we're giving to that token these permissions:
- repo (all of them)
- admin:repo_hook
- user
-
1
-
Nice! I wrote it at StackOverflow to remember it to me of the future... and also to you! :·D Mar 21, 2017 at 14:57
-
@RocBoronat Does this still work for you? I tried your instructions, and while I could login, it did not save my credentials (github.com/travis-ci/travis.rb/issues/588)– arewmMar 15, 2018 at 12:26
-
@arewm sorry, but now I don't use Travis anymore, so I can't try it again. Mar 16, 2018 at 12:57
-
1@RocBoronat No problem. I had someone else from my company try logging in. There is just something bizarre with my computer apparently...– arewmMar 21, 2018 at 16:58
For those still struggling with this, the following helped me:
travis login --pro -X --github-token ${github-token}
Make sure you set the github token for your personal account with access to the private repos as detailed here, and create the token with the following permissions:
For private projects:
- user:email (read-only)
- read:org (read-only)
- repo
for open source projects:
- user:email (read-only)
- read:org (read-only)
- repo_deployment
- repo:status
- write:repo_hook
I have been struggling with this for several months and finally figured it out (accidentally). You can use the -X option to log into enterprise accounts. This might have always been present, but I was not aware of it.
travis login -X --github-token ${my-github-enterprise-token}
Then enter the enterprise domain when prompted and use it as the default endpoint.
-
For enterprise Travis with enterprise GitHub, I had to specify the Travis domain:
travis login -e "https://travis.example.com/api" -X --github-token ...– LeoJan 28, 2019 at 21:19