LinuxCommandLibrary

travis

Manage Travis CI builds from the command line

TLDR

Display the client version

$ travis version
copy

Authenticate the CLI client against the server, using an authentication token
$ travis login
copy

List repositories the user has permissions on
$ travis repos
copy

Encrypt values in .travis.yml
$ travis encrypt [token]
copy

Generate a .travis.yml file and enable the project
$ travis init
copy

SYNOPSIS

travis command [options]
travis --version
travis --help

PARAMETERS

login
    Logs in to Travis CI, typically via GitHub authentication.

logout
    Logs out of Travis CI.

enable
    Enables Travis CI for a specified GitHub repository.

disable
    Disables Travis CI for a specified GitHub repository.

encrypt
    Encrypts a string (e.g., API key) for use in the .travis.yml file.

encrypt-file
    Encrypts a file for use with Travis CI.

status
    Shows the current build status of the repository in the current directory.

logs
    Displays the logs for a specific build job.

restart
    Restarts a specific build job.

rebuild
    Triggers a new build for the repository in the current directory.

lint
    Lints the .travis.yml file to check for syntax errors.

--pro
    Targets the Travis CI Pro (travis-ci.com) platform instead of the open source (travis-ci.org).

--org
    Targets the Travis CI Open Source (travis-ci.org) platform.

--debug
    Enables verbose debugging output.

--skip-version-check
    Skips the check for a newer version of the Travis CLI.

DESCRIPTION

The travis command is the official command-line interface (CLI) for interacting with Travis CI, a popular hosted continuous integration service. It allows developers to manage their Travis CI projects directly from the terminal, automating common tasks and integrating seamlessly with build workflows. With the travis CLI, users can perform operations such as logging in, enabling or disabling repositories, triggering builds, viewing build logs, encrypting sensitive environment variables, and inspecting the status of ongoing and past builds. It acts as a powerful bridge between your local development environment and the Travis CI platform, simplifying the configuration and management of continuous integration and continuous deployment (CI/CD) pipelines. Written as a Ruby Gem, it interacts with the Travis CI API to provide a comprehensive set of functionalities.

CAVEATS

The travis command requires a Ruby environment to be installed on the system, as it is distributed as a Ruby Gem. Its functionality is entirely dependent on the availability and responsiveness of the Travis CI service and the user's authentication credentials. It also assumes a basic understanding of Git and GitHub for repository management and webhooks.

INSTALLATION

The travis command is typically installed via RubyGems. If Ruby and RubyGems are set up on your system, you can install it using: gem install travis. It is recommended to use a Ruby version manager like RVM or rbenv to manage Ruby installations.

CONFIGURATION

The behavior of Travis CI for a repository is primarily defined by a .travis.yml file located in the root of the repository. The travis CLI interacts with and helps manage aspects related to this configuration, such as encrypting sensitive data to be stored within it.

HISTORY

Travis CI emerged in 2011 as one of the early and widely adopted hosted continuous integration services, particularly popular within the open-source community due to its tight integration with GitHub. The travis command-line client was developed alongside the platform, initially as a Ruby Gem, to provide a programmatic interface for interacting with the Travis CI API. Over time, it has evolved to support new features of the Travis CI platform, such as build stages, encrypted environment variables, and enhanced configuration validation (linting), becoming an essential tool for developers and CI/CD engineers managing Travis CI workflows.

SEE ALSO

git(1), curl(1), gh(1)

Copied to clipboard