Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to login into a Travis Enterprise using Travis CLI?

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

like image 429
Roc Boronat Avatar asked Sep 15 '16 14:09

Roc Boronat


People also ask

Can I use Travis CI for free?

If you're not familiar with Travis CI, it's a build company that has been powering the continuous integration (CI) of many open source projects since it launched in 2011. It was the first build solution that was free for open source use and that easily integrated into GitHub.

Which of the following type of commands are supported by Travis CLI?

There are three types of commands: Non-API Commands, General API Commands and Repository Commands. All commands take the form of travis COMMAND [ARGUMENTS] [OPTIONS] .

How does Travis CI work with GitHub?

Travis CI is a cloud-based CI service that builds and tests your projects hosted on GitHub. It would trigger a build process to validate the build and report any failures for every commit made. It fetches the commands from a . travis.


2 Answers

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
like image 192
mdmjsh Avatar answered Nov 15 '22 02:11

mdmjsh


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
like image 26
Roc Boronat Avatar answered Nov 15 '22 01:11

Roc Boronat