Search code examples
travis-citravis-ci-cli

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


Solution

  • 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
    

    To use your own Travis, instead of the common one, for future travis commands

    travis endpoint --set-default -e https://travis.fewlaps.com/api
    

    With this, one can drop the -e https://travis.fewlaps.com/api for the above login command.

    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