Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Travis CI Client (CLI and Ruby library)

License

NotificationsYou must be signed in to change notification settings

travis-ci/travis.rb

Repository files navigation

The Travis Mascot

Thetravis gem includes both acommand line client and aRuby library to interface with a Travis CI service using GitHub account. Both work withtravis-ci.com or any custom Travis CI setup you might have. Check out theinstallation instructions to get it running in no time.

Table of Contents

Command Line Client

There are three types of commands:Non-API Commands,General API Commands andRepository Commands. All commands take the form oftravis COMMAND [ARGUMENTS] [OPTIONS]. You can get a list of commands by runninghelp.

Non-API Commands

Every Travis command takes three global options:

-h, --help                       Display help-i, --[no-]interactive           be interactive and colorful-E, --[no-]explode               don't rescue exceptions

The--help option is equivalent to runningtravis help COMMAND.

The--interactive options determines whether to include additional information and colors in the output or not (except on Windows, we never display colors on Windows, sorry). If you don't set this option explicitly, you will run in interactive mode if you invoke the command directly in a shell and in non-interactive mode if you pipe it somewhere.

You probably want to use--explode if you are working on a patch for the Travis client, as it will give you the Ruby exception instead of a nice error message.

help

Thehelp command will inform you about the arguments and options that the commands take, for instance:

$travishelphelpUsage: travis help [command] [options]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions

Runninghelp without a command name will give you a list of all available commands.

version

As you might have guessed, this command prints out the client's version.

General API Commands

API commands inherit all options fromNon-API Commands.

Additionally, every API command understands the following options:

-e, --api-endpoint URL           Travis API server to talk to    --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'    --pro                        short-cut for --api-endpoint 'https://api.travis-ci.com/'    --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'-t, --token [ACCESS_TOKEN]       access token to use    --debug                      show API requests    --adapter ADAPTER            Faraday adapter to use for HTTP requests

You can supply an access token via--token if you want to make an authenticated call. If you don't have an access token stored for the API endpoint, it will remember it for subsequent requests. Keep in mind, this is not the "Travis token" used when setting up GitHub hooks (due to security). You probably don't have an access token handy right now. Don't worry, usually you won't use this option but instead just do atravis login.

The--debug option will print HTTP requests to STDERR. Like--explode, this is really helpful when contributing to this project.

There are many libraries out there to do HTTP requests in Ruby. You can switch amongst common ones with--adapter:

$travis show --adapter net-http...$gem install excon...$travis show --adapter excon...

accounts

The accounts command can be used to list all the accounts you can set up repositories for.

$travis accountsrkh (Konstantin Haase): subscribed, 160 repositoriessinatra (Sinatra): subscribed, 9 repositoriesrack (Official Rack repositories): subscribed, 3 repositoriestravis-ci (Travis CI): subscribed, 57 repositories...

console

Provides an interactive shell viapry.

Runningtravis console gives you an interactive Ruby session with all theentities imported into global namespace.

This has advantages overirb -r travis, such as:

  • It will take care of authentication, setting the correct endpoint, etc.
  • It also allows you to pass in--debug if you are curious as to what's actually going on.
$travis console>> User.current=> #<User: rkh>>> Repository.find('sinatra/sinatra')=> #<Repository: sinatra/sinatra>>> _.last_build=> #<Travis::Client::Build: sinatra/sinatra#360>
Interactive shell; requires `pry`.Usage: travis console [OPTIONS]-h, --help                       Display help-i, --[no-]interactive           be interactive and colorful-E, --[no-]explode               don't rescue exceptions    --skip-version-check         don't check if travis client is up to date    --skip-completion-check      don't check if auto-completion is set up-e, --api-endpoint URL           Travis API server to talk to-I, --[no-]insecure              do not verify SSL certificate of API endpoint    --pro                        short-cut for --api-endpoint 'https://api.travis-ci.com/'    --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'    --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'    --staging                    talks to staging system-t, --token [ACCESS_TOKEN]       access token to use    --debug                      show API requests    --debug-http                 show HTTP(S) exchange-X, --enterprise [NAME]          use enterprise setup (optionally takes name for multiple setups)    --adapter ADAPTER            Faraday adapter to use for HTTP requests-x, --eval LINE                  run line of ruby

endpoint

Prints out the API endpoint you're talking to.

$travis endpointAPI endpoint: https://api.travis-ci.org/

Handy for using it when working with shell scripts:

$curl"$(travis endpoint)/docs"> docs.html

It can also be used to set the default API endpoint used forGeneral API Commands:

$travis endpoint --com --set-defaultAPI endpoint: https://api.travis-ci.com/ (stored as default)

You can use--drop-default to remove the setting again:

$travis endpoint --drop-defaultdefault API endpoint dropped (was https://api.travis-ci.com/)

login

Thelogin command will, well, log you in. That way, all subsequent commands that run against the same endpoint will be authenticated.

$travis login --pro --github-token ghp_********Successfully logged in as rkh!

You need to use a GitHub token and supply it via--github-token. Travis CI will not store the token, though - after all, it already should have a valid token for you in the database.NOTE: When creating a GitHub token, seeGitHub Permissions used by travis-ci.com orGitHub Permissions used by travis-ci.org. The token permissions are dependent on use of travis-ci.com or travis-ci.org and not if they are public or private repositories.

A third option is for the really lazy:--auto. In this mode the client will try to find a GitHub token for you and just use that. This will only work if you have aglobal GitHub token stored in your.netrc. If you haven't heard of this, it's worth looking into in general. Again: Travis CI will not store that token.

logout

This command makes Travis CI forget your access token.

$travislogout --comSuccessfully logged out!

monitor

Usage: travis monitor [options]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions        --skip-version-check         don't check if travis client is up to date    -e, --api-endpoint URL           Travis API server to talk to        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests    -X, --enterprise [NAME]          use enterprise setup (optionally takes name for multiple setups)    -m, --my-repos                   Only monitor my own repositories    -r, --repo SLUG                  monitor given repository (can be used more than once)    -R, --store-repo SLUG            like --repo, but remembers value for current directory    -n, --[no-]notify [TYPE]         send out desktop notifications (optional type: osx, growl, libnotify)    -b, --builds                     only monitor builds, not jobs    -p, --push                       monitor push events    -P, --pull                       monitor pull request events

Withmonitor you can watch a live stream of what's going on:

$travis monitorMonitoring travis-ci.org:2013-08-05 01:22:40 questmaster/FATpRemote#45 started2013-08-05 01:22:40 questmaster/FATpRemote#45.1 started2013-08-05 01:22:41 grangier/python-goose#33.1 passed2013-08-05 01:22:42 plataformatec/simple_form#666 passed...

You can limit it to a single repository via--repo SLUG.

By default, you will receive events for both builds and jobs, you can limit it to builds only via--build (short-b):

$travis monitorMonitoring travis-ci.org:2013-08-05 01:22:40 questmaster/FATpRemote#45 started2013-08-05 01:22:42 plataformatec/simple_form#666 passed...

Similarly, you can limit it to builds/jobs for pull requests via--pull and for normal pushes via--push.

The monitor command can also send outdesktop notifications:

$travis monitor --com -nMonitoring travis-ci.com:...

When monitoring specific repositories, notifications will be turned on by default. Disable with--no-notify.

raw

This is really helpful both when working on this client and when exploring theTravis API. It will simply fire a request against the API endpoint, parse the output and pretty print it. Keep in mind that the client takes care of authentication for you:

$travis raw /repos/travis-ci/travis.rb{"repo"=>  {"id"=>409371,   "slug"=>"travis-ci/travis.rb",   "description"=>"Travis CI Client (CLI and Ruby library)",   "last_build_id"=>4251410,   "last_build_number"=>"77",   "last_build_state"=>"passed",   "last_build_duration"=>351,   "last_build_language"=>nil,   "last_build_started_at"=>"2013-01-19T18:00:49Z",   "last_build_finished_at"=>"2013-01-19T18:02:17Z"}}

Use--json if you'd rather prefer the output to be JSON.

regenerate-token

This command is used to regenerate the stored API token. New token will be stored in the config.

$travis regenerate-tokenSuccessfully regenerated the token!

remove-token

This command is used to remove the access token from the config, log out the user and disable the token.

$travis remove-tokenSuccessfully removed the access token!

report

When inspecting a bug or reporting an issue, it can be handy to include a report about the system and configuration used for running a command.

$travis report --comSystemRuby:                     Ruby 2.0.0-p195Operating System:         Mac OS X 10.8.5RubyGems:                 RubyGems 2.0.7CLIVersion:                  1.5.8Plugins:                  "travis-as-user", "travis-build", "travis-cli-pr"Auto-Completion:          yesLast Version Check:       2013-11-02 16:25:03 +0100SessionAPI Endpoint:             https://api.travis-ci.com/Logged In:                as "rkh"Verify SSL:               yesEnterprise:               noEndpointspro:                      https://api.travis-ci.com/ (access token, current)org:                      https://api.travis-ci.org/ (access token)Last ExceptionAn error occurred running `travis whoami --com`:    Travis::Client::Error: access denied        from ...For issues with the command line tool, please visit https://github.com/travis-ci/travis.rb/issues.For Travis CI in general, go to https://github.com/travis-ci/travis-ci/issues or email support@travis-ci.com.

This command can also list all known repos and the endpoint to use for them via the--known-repos option.

repos

Lists repositories the user has certain permissions on.Usage: travis repos [options]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions        --skip-version-check         don't check if travis client is up to date        --skip-completion-check      don't check if auto-completion is set up    -e, --api-endpoint URL           Travis API server to talk to    -I, --[no-]insecure              do not verify SSL certificate of API endpoint        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests    -X, --enterprise [NAME]          use enterprise setup (optionally takes name for multiple setups)        --adapter ADAPTER            Faraday adapter to use for HTTP requests    -m, --match PATTERN              only list repositories matching the given pattern (shell style)    -o, --owner LOGIN                only list repos for a certain owner    -n, --name NAME                  only list repos with a given name    -a, --active                     only list active repositories    -A, --inactive                   only list inactive repositories    -d, --admin                      only list repos with (or without) admin access    -D, --no-admin                   only list repos without admin access

Lists repositories and displays whether these are active or not. Has a variety of options to filter repositories.

$travis repos -m'rkh/travis-*'rkh/travis-chat (active: yes, admin: yes, push: yes, pull: yes)Description: example app demoing travis-sso usagerkh/travis-encrypt (active: yes, admin: yes, push: yes, pull: yes)Description: proof of concept in browser encryption of travis settingsrkh/travis-lite (active: no, admin: yes, push: yes, pull: yes)Description: Travis CI without the JavaScriptrkh/travis-surveillance (active: no, admin: yes, push: yes, pull: yes)Description: Veille sur un projet.

In non-interactive mode, it will only output the repository slug, which goes well with xargs:

$travis repos --active --owner travis-ci| xargs -I % travis disable -r %travis-ci/artifacts: disabled :(travis-ci/canary: disabled :(travis-ci/docs-travis-ci-com: disabled :(travis-ci/dpl: disabled :(travis-ci/gh: disabled :(...

sync

Usage: travis sync [options]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions    -e, --api-endpoint URL           Travis API server to talk to        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests    -c, --check                      only check the sync status    -b, --background                 will trigger sync but not block until sync is done    -f, --force                      will force sync, even if one is already running

Sometimes the info Travis CI has about users and repositories become out of date. If that should happen, you can manually trigger a sync:

$travis syncsynchronizing: ........... done

The command blocks until the synchronization is done. You can avoid that with--background:

$travis sync --backgroundstarting synchronization

If you just want to know if your account is being synchronized right now, use--check:

$travis sync --checkrkh is currently syncing

lint

This checks a.travis.yml file for any issues it might detect.

By default, it will read a file named.travis.yml in the current directory:

$travis lintWarnings for .travis.yml:[x] your repository must be feature flagged for the os setting to be used

You can also give it a path to a different file:

$travis lint example.yml...

Or pipe the content into it:

$echo"foo: bar"| travis lintWarnings for STDIN:[x] unexpected key foo, dropping[x] missing key language, defaulting to ruby

Like thestatus command, you can use-q to suppress any output, and-x to have it set the exit code to 1 if there are any warnings.

$travis lint -qx||echo".travis.yml does not validate"

token

In order to use the Ruby library you will need to obtain an access token first. To do this simply run thetravis login command. Once logged in you can check your token withtravis token:

$travis tokenYour access token is super-secret

You can use that token for instance with curl:

$curl -H"Authorization: token$(travis token)" https://api.travis-ci.org/users/{"login":"rkh","name":"Konstantin Haase","email":"konstantin.haase@gmail.com","gravatar_id":"5c2b452f6eea4a6d84c105ebd971d2a4","locale":"en","is_syncing":false,"synced_at":"2013-01-21T20:31:06Z"}

Note that if you just need it for looking at API payloads, that we also have theraw command.

whatsup

It's just a tiny feature, but it allows you to take a look at repositories that have recently seen some action (ie the left hand sidebar ontravis-ci.org):

$travis whatsupmysociety/fixmystreet started: #154eloquent/typhoon started: #228Pajk/apipie-rails started: #84qcubed/framework failed: #21...

If you only want to see what happened in your repositories, add the--my-repos flag (short:-m):

$travis whatsup -mtravis-ci/travis.rb passed: #169rkh/dpl passed: #50rubinius/rubinius passed: #3235sinatra/sinatra errored: #619rtomayko/tilt failed: #162ruby-no-kai/rubykaigi2013 passed: #50rack/rack passed: #519...

whoami

This command is useful to verify that you're in fact logged in:

$travis whoamiYou are rkh (Konstantin Haase)

Again, like most other commands, goes well with shell scripting:

$git clone"https://github.com/$(travis whoami)/some_project"

Repository Commands

-h, --help                       Display help-i, --[no-]interactive           be interactive and colorful-E, --[no-]explode               don't rescue exceptions    --skip-version-check         don't check if travis client is up to date    --skip-completion-check      don't check if auto-completion is set up-e, --api-endpoint URL           Travis API server to talk to-I, --[no-]insecure              do not verify SSL certificate of API endpoint    --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'    --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'-t, --token [ACCESS_TOKEN]       access token to use    --debug                      show API requests-X, --enterprise [NAME]          use enterprise setup (optionally takes name for multiple setups)-r, --repo SLUG                  repository to use (will try to detect from current git clone)-R, --store-repo SLUG            like --repo, but remembers value for current directory

Repository commands have all the optionsGeneral API Commands have.

Additionally, you can specify the Repository to talk to by providing--repo owner/name. However, if you invoke the command inside a clone of the project, the client will figure out this option on its own. Note that it uses the trackedgit remote for the current branch (and defaults to 'origin' if no tracking is set) to do so. You can use--store-repo SLUG once to override it permanently.

It will also automatically picktravis-ci.com if it is a private project. You can of course override this decision with--com,--org or--api-endpoint URL

branches

Displays the most recent build for each branch:

$travis brancheshh-add-warning-old-style:                  #35   passed     Add a warning if old-style encrypt is being usedhh-multiline-encrypt:                      #55   passed     Merge branch 'master' into hh-multiline-encryptrkh-show-logs-history:                     #72   passed     regenerate gemspecrkh-debug:                                 #75   passed     what?hh-add-clear-cache-to-global-session:      #135  passed     Add clear_cache(!) to Travis::Namespacehh-annotations:                            #146  passed     Initial annotation supporthh-remove-newlines-from-encrypted-string:  #148  errored    Remove all whitespace from an encrypted stringversion-check:                             #157  passed     check travis version for updates from time to timemaster:                                    #163  passed     add Repository#branches and Repository#branch(name)

For more fine grained control and older builds on a specific branch, seehistory.

cache

Lists or deletes repository caches.Usage: travis cache [options]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions        --skip-version-check         don't check if travis client is up to date        --skip-completion-check      don't check if auto-completion is set up    -e, --api-endpoint URL           Travis API server to talk to    -I, --[no-]insecure              do not verify SSL certificate of API endpoint        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests    -X, --enterprise [NAME]          use enterprise setup (optionally takes name for multiple setups)    -r, --repo SLUG                  repository to use (will try to detect from current git clone)    -R, --store-repo SLUG            like --repo, but remembers value for current directory    -d, --delete                     delete listed caches    -b, --branch BRANCH              only list/delete caches on given branch    -m, --match STRING               only list/delete caches where slug matches given string    -f, --force                      do not ask user to confirm deleting the caches

Lists or deletesdirectory caches for a repository:

$travis cacheOn branch master:cache--rvm-2.0.0--gemfile-Gemfile      last modified: 2013-11-04 13:45:44  size: 62.21 MiBcache--rvm-ruby-head--gemfile-Gemfile  last modified: 2013-11-04 13:46:55  size: 62.65 MiBOn branch example:cache--rvm-2.0.0--gemfile-Gemfile      last modified: 2013-11-04 13:45:44  size: 62.21 MiBOverall size of above caches: 187.07 MiB

You can filter by branch:

$travis cache --branch masterOn branch master:cache--rvm-2.0.0--gemfile-Gemfile      last modified: 2013-11-04 13:45:44  size: 62.21 MiBcache--rvm-ruby-head--gemfile-Gemfile  last modified: 2013-11-04 13:46:55  size: 62.65 MiBOverall size of above caches: 124.86 MiB

And by matching against the slug:

$travis cache --match 2.0.0On branch master:cache--rvm-2.0.0--gemfile-Gemfile  last modified: 2013-11-04 13:45:44  size: 62.21 MiBOverall size of above caches: 62.21 MiB

You can also use this command to delete caches:

$travis cache -b example -m 2.0.0 --deleteDANGER ZONE: Do you really want to delete all caches on branch example that match 2.0.0? |no| yesDeleted the following caches:On branch example:cache--rvm-2.0.0--gemfile-Gemfile  last modified: 2013-11-04 13:45:44  size: 62.21 MiBOverall size of above caches: 62.21 MiB

cancel

This command will cancel the latest build:

$travis cancelbuild #85 has been canceled

You can also cancel any build by giving a build number:

$travis cancel 57build #57 has been canceled

Or a single job:

$travis cancel 57.1job #57.1 has been canceled

disable

If you want to turn off a repository temporarily or indefinitely, you can do so with thedisable command:

$travis disabletravis-ci/travis.rb: disabled :(

enable

With theenable command, you can easily activate a project on Travis CI:

$travisenabletravis-ci/travis.rb: enabled :)

It even works when enabling a repo Travis didn't know existed by triggering a sync:

$travisenable -r rkh/testrepository not known to Travis CI (or no access?)triggering sync: ............. donerkh/test: enabled

If you don't want the sync to be triggered, use--skip-sync.

encrypt

Encrypts values for the .travis.yml.Usage: travis encrypt [ARGS..] [OPTIONS]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions        --skip-version-check         don't check if travis client is up to date        --skip-completion-check      don't check if auto-completion is set up    -e, --api-endpoint URL           Travis API server to talk to    -I, --[no-]insecure              do not verify SSL certificate of API endpoint        --pro                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'        --staging                    talks to staging system    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests        --debug-http                 show HTTP(S) exchange    -X, --enterprise [NAME]          use enterprise setup (optionally takes name for multiple setups)        --adapter ADAPTER            Faraday adapter to use for HTTP requests    -r, --repo SLUG                  repository to use (will try to detect from current git clone)    -R, --store-repo SLUG            like --repo, but remembers value for current directory    -a, --add [KEY]                  adds it to .travis.yml under KEY (default: env.global)    -s, --[no-]split                 treat each line as a separate input    -p, --append                     don't override existing values, instead treat as list    -x, --override                   override existing value

This command is useful to encryptenvironment variables or deploy keys for private dependencies.

$travis encrypt FOO=barPlease add the following to your .travis.yml file:  secure: "gSly+Kvzd5uSul15CVaEV91ALwsGSU7yJLHSK0vk+oqjmLm0jp05iiKfs08j\n/Wo0DG8l4O9WT0mCEnMoMBwX4GiK4mUmGdKt0R2/2IAea+M44kBoKsiRM7R3\n+62xEl0q9Wzt8Aw3GCDY4XnoCyirO49DpCH6a9JEAfILY/n6qF8="Pro Tip™: You can add it automatically by running with --add.

For deploy keys, it is really handy to pipe them into the command:

$cat id_rsa| travis encrypt

Another use case for piping files into it: If you have a file with sensitive environment variables, like foreman's.env file, you can tell the client to encrypt every line separately via--split:

$cat .env| travis encrypt --splitPlease add the following to your .travis.yml file:  secure: "KmMdcwTWGubXVRu93/lY1NtyHxrjHK4TzCfemgwjsYzPcZuPmEA+pz+umQBN\n1ZhzUHZwDNsDd2VnBgYq27ZdcS2cRvtyI/IFuM/xJoRi0jpdTn/KsXR47zeE\nr2bFxRqrdY0fERVHSMkBiBrN/KV5T70js4Y6FydsWaQgXCg+WEU="  secure: "jAglFtDjncy4E3upL/RF0ZOcmJ2UMrqHFCLQwU8PBdurhTMBeTw+IO6cXx5z\nU5zqvPYo/ghZ8mMuUhvHiGDM6m6OlMP7+l10VTxH1CoVew2NcQvRdfK3P+4S\nZJ43Hyh/ZLCjft+JK0tBwoa3VbH2+ZTzkRZQjdg54bE16C7Mf1A="Pro Tip: You can add it automatically by running with --add.

As suggested, the client can also add them to your.travis.yml for you:

$travis encrypt FOO=bar --add

This will by default add it as global variables for every job. You can also add it as matrix entries by providing a key:

$travis encrypt FOO=bar --add env.matrix

There are two ways the client can treat existing values:

  • Turn existing value into a list if it isn't already, append new value to that list. This is the default behavior for keys that start withenv. and can be enforced with--append.
  • Replace existing value. This is the default behavior for keys that do not start withenv. and can be enforced with--override.

encrypt-file

Encrypts a file and adds decryption steps to .travis.yml.Usage: travis encrypt-file INPUT_PATH [OUTPUT_PATH] [OPTIONS]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions        --skip-version-check         don't check if travis client is up to date        --skip-completion-check      don't check if auto-completion is set up    -e, --api-endpoint URL           Travis API server to talk to    -I, --[no-]insecure              do not verify SSL certificate of API endpoint        --pro                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'        --staging                    talks to staging system    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests        --debug-http                 show HTTP(S) exchange    -X, --enterprise [NAME]          use enterprise setup (optionally takes name for multiple setups)        --adapter ADAPTER            Faraday adapter to use for HTTP requests    -r, --repo SLUG                  repository to use (will try to detect from current git clone)    -R, --store-repo SLUG            like --repo, but remembers value for current directory    -K, --key KEY                    encryption key to be used (randomly generated otherwise)        --iv IV                      encryption IV to be used (randomly generated otherwise)    -d, --decrypt                    decrypt the file instead of encrypting it, requires key and iv    -f, --force                      override output file if it exists    -p, --print-key                  print (possibly generated) key and iv    -w, --decrypt-to PATH            where to write the decrypted file to on the Travis CI VM    -a, --add [STAGE]                automatically add command to .travis.yml (default stage is before_install)

This command will encrypt a file for you using a symmetric encryption (AES-256), and it will store the secret in asecure variable. It will output the command you can use in your build script to decrypt the file.

$travis encrypt-file bacon.txtencrypting bacon.txt for rkh/travis-encrypt-file-examplestoring result as bacon.txt.encstoring secure env variables for decryptionPlease add the following to your build script (before_install stage in your .travis.yml, for instance):    openssl aes-256-cbc -K $encrypted_0a6446eb3ae3_key -iv $encrypted_0a6446eb3ae3_key -in bacon.txt.enc -out bacon.txt -dPro Tip: You can add it automatically by running with --add.Make sure to add bacon.txt.enc to the git repository.Make sure not to add bacon.txt to the git repository.Commit all changes to your .travis.yml.

You can also use--add to have it automatically add the decrypt command to your.travis.yml

$travis encrypt-file bacon.txt --addencrypting bacon.txt for rkh/travis-encrypt-file-examplestoring result as bacon.txt.encstoring secure env variables for decryptionMake sure to add bacon.txt.enc to the git repository.Make sure not to add bacon.txt to the git repository.Commit all changes to your .travis.yml.

env

Show or modify build environment variables.Usage: travis env list [options]       travis env set name value [options]       travis env unset [names..] [options]       travis env copy [names..] [options]       travis env clear [OPTIONS]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions        --skip-version-check         don't check if travis client is up to date        --skip-completion-check      don't check if auto-completion is set up    -e, --api-endpoint URL           Travis API server to talk to    -I, --[no-]insecure              do not verify SSL certificate of API endpoint        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'        --staging                    talks to staging system    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests    -X, --enterprise [NAME]          use enterprise setup (optionally takes name for multiple setups)        --adapter ADAPTER            Faraday adapter to use for HTTP requests        --as USER                    authenticate as given user    -r, --repo SLUG                  repository to use (will try to detect from current git clone)    -R, --store-repo SLUG            like --repo, but remembers value for current directory    -P, --[no-]public                make new values public    -p, --[no-]private               make new values private    -u, --[no-]unescape              do not escape values    -f, --force                      do not ask for confirmation when clearing out all variables

You can set, list and unset environment variables, or copy them from the current environment:

$travis envset foo bar --public[+] setting environment variable $foo$travis env list#environment variablesfor travis-ci/travis.rbfoo=bar$export foo=foobar$travis env copy foo bar[+] setting environment variable $foo[+] setting environment variable $bar$travis env list#environment variablesfor travis-ci/travis.rbfoo=foobarbar=[secure]$travis envunset foo bar[x] removing environment variable $foo[x] removing environment variable $bar

history

Displays a project's build history.Usage: travis history [options]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions        --skip-version-check         don't check if travis client is up to date        --skip-completion-check      don't check if auto-completion is set up    -e, --api-endpoint URL           Travis API server to talk to    -I, --[no-]insecure              do not verify SSL certificate of API endpoint        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests    -X, --enterprise [NAME]          use enterprise setup (optionally takes name for multiple setups)    -r, --repo SLUG                  repository to use (will try to detect from current git clone)    -R, --store-repo SLUG            like --repo, but remembers value for current directory    -a, --after BUILD                Only show history after a given build number    -p, --pull-request NUMBER        Only show history for the given Pull Request    -b, --branch BRANCH              Only show history for the given branch    -l, --limit LIMIT                Maximum number of history items    -d, --date                       Include date in output        --[no-]all                   Display all history items

You can check out what the recent builds look like:

$travishistory#77 passed:   master fix name clash#76 failed:   master Merge pull request #11 from travis-ci/rkh-show-logs-history#75 passed:   rkh-debug what?#74 passed:   rkh-debug all tests pass locally and on the travis vm I spin up :(#73 failed:   Pull Request #11 regenerate gemspec#72 passed:   rkh-show-logs-history regenerate gemspec#71 failed:   Pull Request #11 spec fix for (older) rubinius#70 passed:   rkh-show-logs-history spec fix for (older) rubinius#69 failed:   Pull Request #11 strange fix for rubinius#68 failed:   rkh-show-logs-history strange fix for rubinius

By default, it will display the last 10 builds. You can limit (or extend) the number of builds with--limit:

$travishistory --limit 2#77 passed:   master fix name clash#76 failed:   master Merge pull request #11 from travis-ci/rkh-show-logs-history

You can use--after to display builds after a certain build number (or, well, before, but it's called after to use the same phrases as the API):

$travishistory --limit 2 --after 76#75 passed:   rkh-debug what?#74 passed:   rkh-debug all tests pass locally and on the travis vm I spin up :(

You can also limit the history to builds for a certain branch:

$travishistory --limit 3 --branch master#77 passed:   master fix name clash#76 failed:   master Merge pull request #11 from travis-ci/rkh-show-logs-history#57 passed:   master Merge pull request #5 from travis-ci/hh-multiline-encrypt

Or a certain Pull Request:

$travishistory --limit 3 --pull-request 5#56 passed:   Pull Request #5 Merge branch 'master' into hh-multiline-encrypt#49 passed:   Pull Request #5 improve output#48 passed:   Pull Request #5 let it generate accessor for line splitting automatically

init

Usage: travis init [language] [file] [options]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions        --skip-version-check         don't check if travis client is up to date    -e, --api-endpoint URL           Travis API server to talk to        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests        --adapter ADAPTER            Faraday adapter to use for HTTP requests    -r, --repo SLUG                  repository to use (will try to detect from current git clone)    -R, --store-repo SLUG            like --repo, but remembers value for current directory    -s, --skip-sync                  don't trigger a sync if the repo is unknown    -f, --force                      override .travis.yml if it already exists    -k, --skip-enable                do not enable project, only add .travis.yml    -p, --print-conf                 print generated config instead of writing to file        --script VALUE               sets script option in .travis.yml (can be used more than once)        --before-script VALUE        sets before_script option in .travis.yml (can be used more than once)        --after-script VALUE         sets after_script option in .travis.yml (can be used more than once)        --after-success VALUE        sets after_success option in .travis.yml (can be used more than once)        --install VALUE              sets install option in .travis.yml (can be used more than once)        --before-install VALUE       sets before_install option in .travis.yml (can be used more than once)        --compiler VALUE             sets compiler option in .travis.yml (can be used more than once)        --otp-release VALUE          sets otp_release option in .travis.yml (can be used more than once)        --go VALUE                   sets go option in .travis.yml (can be used more than once)        --jdk VALUE                  sets jdk option in .travis.yml (can be used more than once)        --node-js VALUE              sets node_js option in .travis.yml (can be used more than once)        --perl VALUE                 sets perl option in .travis.yml (can be used more than once)        --php VALUE                  sets php option in .travis.yml (can be used more than once)        --python VALUE               sets python option in .travis.yml (can be used more than once)        --rvm VALUE                  sets rvm option in .travis.yml (can be used more than once)        --scala VALUE                sets scala option in .travis.yml (can be used more than once)        --env VALUE                  sets env option in .travis.yml (can be used more than once)        --gemfile VALUE              sets gemfile option in .travis.yml (can be used more than once)

When setting up a new project, you can runtravis init to generate a.travis.yml andenable the project:

$travis init java.travis.yml file created!travis-ci/java-example: enabled :)

You can also set certain values via command line flags (see list above):

$travis init c --compiler clang.travis.yml file created!travis-ci/c-example: enabled :)

logs

Given a job number, logs simply prints out that job's logs. By default it will display the first job of the latest build.

$travis logsdisplaying logs for travis-ci/travis.rb#317.1[... more logs ...]Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.$bundleexec rake/home/travis/.rvm/rubies/ruby-1.8.7-p371/bin/ruby -S rspec spec -c..............................................................................................................................................................................................................................................................................Finished in 4.46 seconds270 examples, 0 failuresDone. Build script exited with: 0

The info line about the job being displayed is written to stderr, the logs itself are written to stdout.

It takes an optional argument that can be a job number:

$travis logs 100.3displaying logs for travis-ci/travis.rb#100.3

A build number (in which case it will pick the build's first job):

$travis logs 100displaying logs for travis-ci/travis.rb#100.1

Just the job suffix, which will pick the corresponding job from the latest build:

$travis logs .2displaying logs for travis-ci/travis.rb#317.2

A branch name:

$travis logs ghedisplaying logs for travis-ci/travis.rb#270.1

You can delete the logs with the--delete flag, which optionally takes a reason as argument:

$travis logs --deleteDANGER ZONE: Do you really want to delete the build log for travis-ci/travis.rb#559.1? |no| yesdeleting log for travis-ci/travis.rb#559.1$travis logs 1.7 --delete"contained confidential data" --forcedeleting log for travis-ci/travis.rb#1.7

open

Opens the project view in the Travis CI web interface. If you pass it a build or job number, it will open that specific view:

$travis open

If you just want the URL printed out instead of opened in a browser, pass--print.

If instead you want to open the repository, compare or pull request view on GitHub, use--github.

$travis open 56 --print --githubweb view: https://github.com/travis-ci/travis.rb/pull/5

pubkey

Outputs the public key for a repository.

$travis pubkeyPublic key for travis-ci/travis.rb:ssh-rsa ...$travis pubkey -r rails/rails> rails.key

The--pem flag will print out the key PEM encoded:

$travis pubkey --pemPublic key for travis-ci/travis.rb:-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----

Whereas the--fingerprint flag will print out the key's fingerprint:

$travis pubkey --fingerprintPublic key for travis-ci/travis.rb:9f:57:01:4b:af:42:67:1e:b4:3c:0f:b6:cd:cc:c0:04

requests

With therequests command, you can list the build requests received by Travis CI from GitHub. This is handy for figuring out why a repository might not be building.

$travis requests -r sinatra/sinatrapush to master accepted (triggered new build)  abc51e2 - Merge pull request #847 from gogotanaka/add_readme_ja  received at: 2014-02-16 09:26:36PR #843 rejected (skipped through commit message)  752201c - Update Spanish README with tense, verb, and word corrections. [ci skip]  received at: 2014-02-16 05:07:16

You can use-l/--limit to limit the number of requests displayed.

restart

This command will restart the latest build:

$travis restartbuild #85 has been restarted

You can also restart any build by giving a build number:

$travis restart 57build #57 has been restarted

Or a single job:

$travis restart 57.1job #57.1 has been restarted
settings

Certain repository settings can be read via the CLI:

$travis settingsSettings for travis-ci/travis.rb:[-] builds_only_with_travis_yml    Only run builds with a .travis.yml[+] build_pushes                   Build pushes[+] build_pull_requests            Build pull requests[-] maximum_number_of_builds       Maximum number of concurrent builds

You can also filter the settings by passing them in as arguments:

$travis settings build_pushes build_pull_requestsSettings for travis-ci/travis.rb:[+] build_pushes                   Build pushes[+] build_pull_requests            Build pull requests

It is also possible to change these settings via--enable,--disable and--set:

$travis settings build_pushes --disableSettings for travis-ci/travis.rb:[-] build_pushes                   Build pushes$travis settings maximum_number_of_builds --set 1Settings for travis-ci/travis.rb:  1 maximum_number_of_builds       Maximum number of concurrent builds

Or, alternatively, you can use-c to configure the settings interactively:

$travis settings -cSettings for travis-ci/travis.rb:Only run builds with a .travis.yml? |yes| noBuild pushes? |no| yesBuild pull requests? |yes|Maximum number of concurrent builds: |1| 5

setup

Helps you configure Travis addons.

Usage: travis setup service [options]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions        --skip-version-check         don't check if travis client is up to date    -e, --api-endpoint URL           Travis API server to talk to        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests        --adapter ADAPTER            Faraday adapter to use for HTTP requests    -r, --repo SLUG                  repository to use (will try to detect from current git clone)    -R, --store-repo SLUG            like --repo, but remembers value for current directory    -f, --force                      override config section if it already exists

Available services:anynines,appfog,artifacts,biicode,cloudcontrol,cloudfiles,cloudfoundry,cloud66,codedeploy,deis,divshot,elasticbeanstalk,engineyard,gcs,hackage,heroku,modulus,npm,ninefold,nodejitsu,openshift,opsworks,pypi,releases,rubygems,s3 andsauce_connect.

Example:

$travis setup herokuDeploy only from travis-ci/travis-chat? |yes|Encrypt API key? |yes|

show

Displays general info about the latest build:

$travis showBuild #77: fix name clashState:         passedType:          pushCompare URL:   https://github.com/travis-ci/travis.rb/compare/7cc9b739b0b6...39b66ee24abeDuration:      5 min 51 secStarted:       2013-01-19 19:00:49Finished:      2013-01-19 19:02:17#77.1 passed:    45 sec         rvm: 1.8.7#77.2 passed:    50 sec         rvm: 1.9.2#77.3 passed:    45 sec         rvm: 1.9.3#77.4 passed:    46 sec         rvm: 2.0.0#77.5 failed:    1 min 18 sec   rvm: jruby (failure allowed)#77.6 passed:    1 min 27 sec   rvm: rbx

Any other build:

$travis show 1Build #1: add .travis.ymlState:         failedType:          pushCompare URL:   https://github.com/travis-ci/travis.rb/compare/ad817bc37c76...b8c5d3b463e2Duration:      3 min 16 secStarted:       2013-01-13 23:15:22Finished:      2013-01-13 23:21:38#1.1 failed:     21 sec         rvm: 1.8.7#1.2 failed:     34 sec         rvm: 1.9.2#1.3 failed:     24 sec         rvm: 1.9.3#1.4 failed:     52 sec         rvm: 2.0.0#1.5 failed:     38 sec         rvm: jruby#1.6 failed:     27 sec         rvm: rbx

The last build for a given branch:

$travis show rkh-debugBuild #75: what?State:         passedType:          pushBranch:        rkh-debugCompare URL:   https://github.com/travis-ci/travis.rb/compare/8d4aa5254359...7ef33d5e5993Duration:      6 min 16 secStarted:       2013-01-19 18:51:17Finished:      2013-01-19 18:52:43#75.1 passed:    1 min 10 sec   rvm: 1.8.7#75.2 passed:    51 sec         rvm: 1.9.2#75.3 passed:    36 sec         rvm: 1.9.3#75.4 passed:    48 sec         rvm: 2.0.0#75.5 failed:    1 min 26 sec   rvm: jruby (failure allowed)#75.6 passed:    1 min 25 sec   rvm: rbx

Or a job:

$travis show 77.3Job #77.3: fix name clashState:         passedType:          pushCompare URL:   https://github.com/travis-ci/travis.rb/compare/7cc9b739b0b6...39b66ee24abeDuration:      45 secStarted:       2013-01-19 19:00:49Finished:      2013-01-19 19:01:34Allow Failure: falseConfig:        rvm: 1.9.3

sshkey

Checks, updates or deletes an SSH key.Usage: travis sshkey [OPTIONS]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions    -e, --api-endpoint URL           Travis API server to talk to    -I, --[no-]insecure              do not verify SSL certificate of API endpoint        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests    -X, --enterprise [NAME]          use enterprise setup (optionally takes name for multiple setups)    -r, --repo SLUG                  repository to use (will try to detect from current git clone)    -R, --store-repo SLUG            like --repo, but remembers value for current directory    -D, --delete                     remove SSH key    -d, --description DESCRIPTION    set description    -u, --upload FILE                upload key from given file    -s, --stdin                      upload key read from stdin    -c, --check                      set exit code depending on key existing    -g, --generate                   generate SSH key and set up for given GitHub user    -p, --passphrase PASSPHRASE      pass phrase to decrypt with when using --upload

This feature is forprivate and Enterprise only.

With thesshkey command you can check if there is a custom SSH key set up. Custom SSH keys are used for cloning the repository.

$travis sshkeyNo custom SSH key installed.

You can also use it to upload an SSH key:

$travis sshkey --upload~/.ssh/id_rsaKey description: Test Keyupdating ssh key for travis-pro/test-project with key from /Users/konstantin/.ssh/id_rsaCurrent SSH key: Test Key

And to remove it again:

$travis sshkey --deleteDANGER ZONE: Remove SSH key for travis-pro/test-project? |no| yesremoving ssh key for travis-pro/test-projectNo custom SSH key installed.

You can also have it generate a key for a given GitHub user (for instance, for a dedicated CI user that only has read access). The public key will automatically be added to GitHub and the private key to Travis CI:

$travis sshkey --generateWe need the GitHub login for the account you want to add the key to.This information will not be sent to Travis CI, only to api.github.com.The password will not be displayed.Username: travisbotPassword for travisbot: **************Generating RSA key.Uploading public key to GitHub.Uploading private key to Travis CI.

SeePrivate Dependencies for an in-detail description.

status

Usage: travis status [options]    -h, --help                       Display help    -i, --[no-]interactive           be interactive and colorful    -E, --[no-]explode               don't rescue exceptions    -e, --api-endpoint URL           Travis API server to talk to        --com                        short-cut for --api-endpoint 'https://api.travis-ci.com/'        --org                        short-cut for --api-endpoint 'https://api.travis-ci.org/'    -t, --token [ACCESS_TOKEN]       access token to use        --debug                      show API requests    -r, --repo SLUG                  repository to use (will try to detect from current git clone)    -R, --store-repo SLUG            like --repo, but remembers value for current directory    -x, --[no-]exit-code             sets the exit code to 1 if the build failed    -q, --[no-]quiet                 does not print anything    -p, --[no-]fail-pending          sets the status code to 1 if the build is pending

Outputs a one line status message about the project's last build. With-q that line will even not be printed out. How's that useful? Combine it with-x and the exit code will be 1 if the build failed, with-p and it will be 1 for a pending build.

$travis status -qpx&& cap deploy

Travis CI and Travis CI Enterprise

By default,General API Commands will talk toapi.travis-ci.org. You can change this by supplying--com forapi.travis-ci.com or--api-endpoint with your own endpoint. Note that allRepository Commands will try to figure out the API endpoint to talk to automatically depending on the project's visibility on GitHub.

$travis login --com...$travis monitor --com -m...

The custom--api-endpoint option is handy for local development:

$travis whatsup --api-endpoint http://localhost:3000...

If you have a Travis Enterprise setup in house, you can use the--enterprise option (or short-X). It will ask you for the enterprise domain the first time it is used.

$travis login -XEnterprise domain: travisci.example.com...$travis whatsup -X...

Note that currentlyRepository Commands will not be able to detect Travis Enterprise automatically. You will have to use the-X flag at least once per repository. The command line tool will remember the API endpoint for subsequent commands issued against the same repository.

Environment Variables

You can set the following environment variables to influence the travis behavior:

  • $TRAVIS_TOKEN - access token to use when the--token flag is not used
  • $TRAVIS_ENDPOINT - API endpoint to use when the--api-endpoint,--org or--com flag is not used
  • $TRAVIS_CONFIG_PATH - directory to store configuration in (defaults to ~/.travis)

Desktop Notifications

Some commands support sending desktop notifications. The following notification systems are currently supported:

  • Notification Center - requires Mac OSX 10.8 or later andNotification Center must be running under the system executing thetravis command.
  • Growl -growlnotify has to be installed andGrowl needs to be running. Does currently not support the Windows version of Growl.
  • libnotify - needslibnotify installed, including thenotify-send executable.

Plugins

Thetravis binary has rudimentary support for plugins: It tries to load all files matching~/.travis/*/init.rb. Note that the APIs plugins use are largely semi-private. That is, they should remain stable, but are not part of the public API covered by semantic versioning. You can list the installed plugins viatravis report.

It is possible to define new commands directly in theinit.rb or to set uplazy-loading for these.

Official Plugins

Ruby Library

There are two approaches of using the Ruby library, one straight forward with one global session:

require'travis'rails=Travis::Repository.find('rails/rails')puts"oh no"unlessrails.green?

And one where you have to instantiate your own session:

require'travis/client'client=Travis::Client.newrails=client.repo('rails/rails')puts"oh no"unlessrails.green?

For most parts, those are pretty much the same, the entities you get back look the same, etc, except one offers nice constants as part of the API, the other doesn't. In fact the "global" session style usesTravis::Client internally.

So, which one to choose? The global style has one session, whereas with the client style, you have one session per client instance. Each session has its own cache and identity map. This might matter for long running processes. If you use a new session for separate units of work, you can be pretty sure to not leak any objects. On the other hand using the constants or reusing the same session might save you from unnecessary HTTP requests.

In either way, if you should use the first approach or long living clients, here is how you make sure not to have stale data around:

Travis.clear_cacheclient.clear_cache

Note that this will still keep the identity map around, it will only drop all attributes. To clear the identity map, you can use theclear_cache! method. However, if you do that, you should not keep old instances of any entities (like repositories, etc) around.

Authentication

Authentication is pretty easy, you just need to set an access token:

require'travis'Travis.access_token="..."puts"Hello#{Travis::User.current.name}!"

Or with your own client instance:

require'travis/client'client=Travis::Client.new(access_token:"...")puts"Hello#{client.user.name}"

Seethe token command for obtaining the access token used by the CLI.

If you don't have an access token for Travis CI, you can use a GitHub access token to get one:

require'travis'Travis.github_auth("...")puts"Hello#{Travis::User.current.name}!"

Travis CI will not store that token.

There is alsotravis/auto_login, which will try to read the CLI configuration or .netrc for a Travis CI or GitHub token to authenticate with automatically:

require'travis/auto_login'puts"Hello#{Travis::User.current.name}!"

Using Pro

Using the library with private projects pretty much works the same, except you useTravis::Pro.

Keep in mind that you need to authenticate.

require'travis/pro'Travis::Pro.access_token='...'user=Travis::Pro::User.currentputs"Hello#{user.name}!"

There is alsotravis/pro/auto_login, which will try to read the CLI configuration or .netrc for a Travis CI or GitHub token to authenticate with automatically:

require'travis/pro/auto_login'puts"Hello#{Travis::Pro::User.current.name}!"

Entities

Entities are like the models in the Travis Client land. They keep the data and it's usually them you talk to if you want something.They are pretty much normal Ruby objects.

The Travis session will cache all entities, so don't worry about loading the same one twice.Once you got a hold of one, you can easily reload it at any time if you want to make sure the data is fresh:

rails=Travis::Repository.find('rails/rails')sleep1.hourrails.reload

The travis gem supports lazy and partial loading, so if you want to make sure you have all the data, just call load.

rails.load

This is not something you should usually do, as partial loading is actually your friend (keeps requests to a minimum).

Stateful Entities

Repositories,Builds andJobs all are basically state machines, which means they implement the following methods:

require'travis'build=Travis::Repository.find('rails/rails').last_buildpbuild.canceled?pbuild.created?pbuild.errored?pbuild.failed?pbuild.finished?pbuild.green?pbuild.passed?pbuild.pending?pbuild.queued?pbuild.red?pbuild.running?pbuild.started?pbuild.successful?pbuild.unsuccessful?pbuild.yellow?pbuild.color

Builds and jobs also have astate method. For repositories, uselast_build.state.

Repositories

Repositories are probably one of the first entities you'll load. It's pretty straight forward, too.

require'travis'Travis::Repository.find('rails/rails')# find by slugTravis::Repository.find(891)# find by idTravis::Repository.find_all(owner_name:'rails')# all repos in the rails organizationTravis::Repository.current# repos that see some action right now# all repos with the same owner as the repo with id 891Travis::Repository.find(891).owner.repositories

Once you have a repository, you can for instance encrypt some strings with its private key:

require'travis'Travis::Repository.find('rails/rails')putsrepo.encrypt('FOO=bar')

Repositories arestateful.

You can enable or disable a repository with the methods that go by the same name.

rails.disablesystem"push all the things"rails.enable

If you want to enable a new project, you might have to do a sync first.

Builds

You could load a build by its id usingTravis::Build.find. But most of the time you won't have the id handy, so you'd usually start with a repository.

require'travis'rails=Travis::Repository.find('rails/rails')rails.last_build# the latest buildrails.recent_builds# the last 20 or so builds (don't rely on that number)rails.builds(after_number:42)# the last 20 or so builds *before* 42rails.build(42)# build with the number 42 (not the id!)rails.builds# Enumerator for #each_build# this will loop through all buildsrails.each_builddo |build|puts"#{build.number}:#{build.state}"end# this will loop through all builds before build 42rails.each_build(after_number:42)do |build|puts"#{build.number}:#{build.state}"end

Note thateach_build (and thusbuilds without and argument) is lazy and uses pagination, so you can safely do things like this:

build=rails.builds.detect{ |b|b.failed?}puts"Last failing Rails build:#{build.number}"

Without having to load more than 6000 builds.

You can restart a build, if the current user has sufficient permissions on the repository:

rails.last_build.restart

Same goes for canceling it:

rails.last_build.cancel

You can also retrieve a Hash mapping branch names to the latest build on that given branch viabranches or use thebranch method to get the last build for a specific branch:

ifrails.branch('4-0-stable').green?puts"Time for another 4.0.x release!"endcount=rails.branches.sizeputs"#{count} rails branches tested on travis"

Jobs

Jobs behave a lot likebuilds, and similar to them, you probably don't have the id ready. You can get the jobs from a build:

rails.last_build.jobs.eachdo |job|puts"#{job.number} took#{job.duration} seconds"end

If you have the job number, you can also reach a job directly from the repository:

rails.job('5000.1')

Like builds, you can also restart singe jobs:

rails.job('5000.1').restart

Same goes for canceling it:

rails.job('5000.1').cancel

Artifacts

The artifacts you usually care for are probably logs. You can reach them directly from a build:

require'travis'repo=Travis::Repository.find('travis-ci/travis.rb')job=repo.last_build.jobs.firstputsjob.log.body

If you plan to print out the body, be aware that it might contain malicious escape codes. For this reason, we addedcolorized_body, which removes all the unprintable characters, except for ANSI color codes, andclean_body which also removes the color codes.

putsjob.log.colorized_body

You can stream a body for a job that is currently running by passing a block:

job.log.body{ |chunk|printchunk}

Users

The only user you usually get access to is the currently authenticated one.

require'travis'Travis.access_token='...'user=Travis::User.currentputs"Hello,#{user.login}! Or should I call you...#{user.name.upcase}!?"

If some data gets out of sync between GitHub and Travis, you can use the user object to trigger a new sync.

Travis::User.current.sync

Commits

Commits cannot be loaded directly. They come as a byproduct ofjobs andbuilds.

require'travis'repo=Travis::Repository.find('travis-ci/travis.rb')commit=repo.last_build.commitputs"Last tested commit:#{commit.short_sha} on#{commit.branch} by#{commit.author_name} -#{commit.subject}"

Caches

Caches can be fetched for a repository.

require'travis/pro'Travis::Pro.access_token="MY SECRET TOKEN"repo=Travis::Pro::Repository.find("my/rep")repo.caches.eachdo |cache|puts"#{cache.branch}:#{cache.size}"cache.deleteend

It is also possible to delete multiple caches with a single API call:

repo.delete_caches(branch:"master",match:"rbx")

Repository Settings

You can access a repositories settings viaRepository#settings:

require'travis'Travis.access_token="MY SECRET TOKEN"settings=Travis::Repository.find('my/repo').settingsifsettings.build_pushes?settings.build_pushes=falsesettings.saveend

Build Environment Variables

You can access environment variables viaRepository#env_vars:

require'travis'Travis.access_token="MY SECRET TOKEN"env_vars=Travis::Repository.find('my/repo').env_varsenv_vars['foo']='bar'env_vars.upsert('foo','foobar',public:true)env_vars.each{ |var|var.delete}

Dealing with Sessions

Under the hood the session is where the fun is happening. Most methods on the constants and entities just wrap methods on your session, so you don't have to pass the session around all the time or even see it if you don't want to.

There are two levels of session methods, the higher level methods from theTravis::Client::Methods mixin, which are also available fromTravis,Travis::Pro or any customNamespace.

require'travis/client/session'session=Travis::Client::Session.newsession.access_token="secret_token"# access token to usesession.api_endpoint="http://localhost:3000/"# api endpoint to talk tosession.github_auth("github_token")# log in with a github tokensession.repos(owner_name:'travis-ci')# all travis-ci/* projectssession.repo('travis-ci/travis.rb')# this projectsession.repo(409371)# same as the one abovesession.build(4266036)# build with id 4266036session.job(4266037)# job with id 4266037session.artifact(42)# artifact with id 42session.log(42)# same as abovesession.user# the current user, if logged insession.restart(session.build(4266036))# restart some buildsession.cancel(session.build(4266036))# cancel some build

You can add these methods to any object responding tosession via said mixin.

Below this, there is a second API, close to the HTTP level:

require'travis/client/session'session=Travis::Client::Session.newsession.instrumentdo |description,block|time=Time.nowblock.callputs"#{description} took#{Time.now -time} seconds"endsession.connection=Faraday::Connection.newsession.get_raw('/repos/rails/rails')# => {"repo" => {"id" => 891, "slug" => "rails/rails", ...}}session.get('/repos/rails/rails')# => {"repo" => #<Travis::Client::Repository: rails/rails>}session.headers['Foo']='Bar'# send a custom HTTP header with every requestrails=session.find_one(Travis::Client::Repository,'rails/rails')session.find_many(Travis::Client::Repository)# repositories with the latest buildssession.find_one_or_many(Travis::Client::User)# the current user (you could also use find_one here)session.reload(rails)session.reset(rails)# lazy reloadsession.clear_cache# empty cached attributessession.clear_cache!# empty identity map

Listening for Events

You can use thelisten method to listen for events on repositories, builds or jobs:

require'travis'rails=Travis::Repository.find("rails/rails")sinatra=Travis::Repository.find("sinatra/sinatra")Travis.listen(rails,sinatra)do |stream|stream.on('build:started','build:finished')do |event|# ie "rails/rails just passed"puts"#{event.repository.slug} just#{event.build.state}"endend

Current events arebuild:created,build:started,build:finished,job:created,job:started,job:finished andjob:log (the last one only when subscribing to jobs explicitly). Not passing any arguments tolisten will monitor the global stream.

Using Namespaces

Travis andTravis::Pro are just two different namespaces for two different Travis sessions. A namespace is a Module, exposing the higher levelsession methods. It also has a dummy constant for everyentity, wrappingfind_one (aliased tofind) andfind_many (aliased tofind_all) for you, so you don't have to keep track of the session or hand in the entity class. You can easily create your own namespace:

require'travis/client'MyTravis=Travis::Client::Namespaces.new("http://localhost:3000")MyTravis.access_token="..."MyTravis::Repository.find("foo/bar")

Since namespaces are Modules, you can also include them.

require'travis/client'classMyTravisincludeTravis::Client::Namespaces.newendMyTravis::Repository.find('rails/rails')

Installation

Make sure you have at leastRuby 2.3.0 (2.6.0 recommended) installed.

You can check your Ruby version by runningruby -v:

$ ruby -vruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

Then run:

On OSX and Linux:

$ gem install travis --no-document

(For older versions ofgem, replace--no-document with--no-rdoc --no-ri.)

On Windows:

$ gem install travis

If you do not have write access to the system gem directory, you'll need to perform a local install by adding--user-install. You also need to ensure the local gem directory is on your PATH.

Now make sure everything is working:

$ travis version1.14.0

See alsoNote on Ubuntu below.

Note on Ruby 2.3

For Ruby 2.3.x, be sure to have a compatible version offaraday installed; e.g.,

$ gem install faraday -v 1.0.1

Development Version

You can also install the development version via RubyGems:

$ gem install travis --pre

We automatically publish a new development version after every successful build.

Running Locally

If you want to try out your changes locally:

bundle install # install the dependenciesbundle exec bin/travis a-command # run your command

Updating your Ruby

If you have an outdated Ruby version, or your OS doesn't come with Ruby pre-installed,you should use your package system or a Ruby Installer to install a recent Ruby.

Mac OS X via Homebrew

You can useHomebrew to install a recent version:

$ brew install ruby$ gem update --system

Windows

On Windows, we recommend using theRubyInstaller, which includes the latest version of Ruby.

Other Unix systems

On other Unix systems, like Linux, use your package system to install Ruby.

Debian, Ubuntu:

$ sudo apt-get update$ sudo apt-get install ruby

For other Linux distributions, refer to their respective documentation.

Ruby versioning tools

Alternatively, you can use a Ruby version management tool such asrvm,rbenv orchruby. This is only recommended if you need to run multiple versions of Ruby.

You can of course always compile Ruby from source, though then you are left with the hassle of keeping it up to date and making sure that everything is set up properly.

Troubleshooting

Upgrading from travis-cli

If you have the oldtravis-cli gem installed, you shouldgem uninstall travis-cli, just to be sure, as it ships with an executable that is also namedtravis.

uninitialized constant Faraday::Error::ConnectionFailed

You might see this error message if you have Typhoeus version prior to version 1.4.0and Faraday 1.0 and up.You can eradicate this problem by either:

  1. Update Typhoeus to version 1.4.0 or later
  2. Remove typhoeus entirely

See#768 (comment) for more details.

Version History

1.14.0

  • Remove org references#861

1.13.0

  • Default API endpoint switched#840
  • Api key regenerate#842

1.12.0

  • Upgraded ruby version to 3.2#848
  • Added API Key Reset Capabilities#842
  • Fix travis lint issues#840

1.11.1

  • Fixtravis sshkey --generate#820

1.11.0

  • Removed authentication with password#811

1.10.1

  • Fixtravis monitor command#770

1.10.0 (September 22, 2020)

  • Requires Ruby 2.3.0 or later (2.6.0 or later is recommended)
  • Display a meaningful message when Travis API is unavailable.#753
  • Eschewwhich to find a command on the system.#765
  • Fix--list-github-token flag.#766
  • FFI is no longer required.#758
  • Typhoeus is no longer required, but remains supported (used if installed).#756

1.9.1 (May 19, 2020)

  • Fix--no-interactive flag inencrypt andencrypt-file commands#738
  • Display commit SHA inshow#739
  • Display more helpful message when GitHub token given by--github-token isdeficient#708
  • Fix--pull-request flag inhistory command#382

1.9.0 (April 27, 2020)

  • Require Ruby 2.3 and up

  • Add Ruby 2.7 support

  • Validate-r argument form#281

  • Verify.travis.yml is valid before sending to the server#706

  • Skip version check if rubygems.org is down#246

  • Documentation updates#641#567#446#363#665#737

  • Fixjson dependency#508

  • Addbash template#332

  • Addelixir template#471

  • Hardcodepgrep path#570

  • Fixtravis restart command#416

  • Defineskip_cleanup forsetup command if usingdpl v1#704

  • Prevent.bashrc from failing when init file is not present#595

1.8.13 (April 7, 2020)

1.8.12 (March 23, 2020)

  • Fixencrypt-file command (#715)
  • Fixconsole command (#654)
  • Ask for confirmation whenencrypt andencrypt-file commands receive-a,--add flag (#651)

1.8.11 (March 2, 2020)

  • Generate unique key-iv pair for each file (#678)
  • Add logout command

1.8.10 (May 5, 2019)

1.8.8 (March 3, 2017)

  • Fix auto-login for when token is locally available

1.8.0 (July 15, 2015)

  • Fix listener for pusher changes ontravis-ci.org.
  • Changemonitor command to only monitor personal repositories ifcommon channel is not available.

1.7.7 (May 26, 2015)

  • Fixtravis whatsup for fresh Travis Enterprise installations.

1.7.6 (April 08, 2015)

  • Add support for "received" build state.
  • Fix issue with archived logs.
  • On version check, do not kill the process if a newer version has been released.

1.7.5 (January 15, 2015)

  • Add support for url..insteadOf
  • Fix packaging error with 1.7.4, in which Code Deploy setup code was not included

1.7.4 (November 12, 2014)

  • Addtravis setup codedeploy

1.7.3 (November 10, 2014)

  • Addtravis setup biicode
  • Addtravis env clear
  • Print error message iftravis login is run for a GitHub account unknown to the Travis CI setup.
  • Fix bug in S3 ACL settings.
  • Maketravis console work with newer pry versions.

1.7.2 (September 17, 2014)

  • Addtravis setup elasticbeanstalk.
  • Properly display educational accounts intravis accounts.
  • Upgrade go version default fortravis init.
  • Fix SSL verification issue on OS X Yosemite and certain Linux setups.
  • Be more forgiving with outdated API version (Enterprise).
  • Better handling of multibyte characters in archived logs.
  • Use more restrictive permissions for the config file.

1.7.1 (August 9, 2014)

  • Better error message when trying to encrypt a string that is too long.
  • Fix Validation failed error usingtravis sshkey --upload.

1.7.0 (August 5, 2014)

  • Addtravis encrypt-file.
  • Add--store-repo/-R to repository commands to permanently store the slug for a repository.
  • Announce repository slug when first detected, ask for confirmation in interactive mode.
  • Havetravis repos only print repository slugs in non-interactive mode.
  • Addtravis/auto_login andtravis/pro/auto_login to the Ruby API for easy authentication.
  • Add--fingerprint topubkey command.
  • Addfingerprint toRepository#public_key.
  • Display better error messages for user errors (user data validation failing, etc).
  • Havetravis sshkey --upload check that the content is a private key.
  • Maketravis sshkey --upload prompt for and remove the pass phrase if the key is encrypted.

1.6.17 (July 25, 2014)

  • Addtravis sshkey and corresponding Ruby API.
  • Make desktop notifications work on Mac OS X 10.10.

1.6.16 (July 19, 2014)

  • Fix check for updates.

1.6.15 (July 18, 2014)

  • Addtravis env [list|add|set|copy].
  • AddRepository#env_vars.
  • Addtravis setup ghc.
  • AddLog#delete_body,Job#delete_log andBuild#delete_logs to Ruby API.
  • Add--delete,--force and--no-stream options totravis logs.
  • Addacl option totravis setup s3.
  • Add--set option totravis settings, support non-boolean values.
  • Exposemaximum_number_of_builds setting.
  • Give GitHub OAuth token generated bytravis setup releases a proper description.
  • Proper handling for empty or broken config files.
  • Reset terminal colors aftertravis logs.

1.6.14 (June 17, 2014)

  • Addtravis lint command and Ruby API.

1.6.13 (June 15, 2014)

  • Added Deis and Hackage setup support.

1.6.12 (June 12, 2014)

  • Added artifacts setup support.

1.6.11 (May 12, 2014)

  • Added Cloud 66 and Ninefold setup support.
  • Require typhoeus 0.6.8 and later.

1.6.10 (April 24, 2014)

  • Better CloudFoundry support
  • Update Faraday to version 0.9.

1.6.9 (April 9, 2014)

  • Add--limit totravis requests.
  • Add--committer option totravis history.
  • Avoid error when runningtravis login with a revoked token.
  • Addtravis setup releases.
  • Desktop notifications via libnotify are now transient (disappear on their own if the user is active).
  • Update Rubinius version generated bytravis init ruby.
  • Improve setup when runningtravis executable that has not been installed via RubyGems.

1.6.8 (March 12, 2014)

  • Display annotations intravis show.
  • Addtravis requests to see build requests Travis CI has received.
  • Improve annotation support in the Ruby library.
  • AddRepository#requests to Ruby library.
  • Fix behavior for missing entities.

1.6.7 (January 30, 2014)

  • Properly display OS for projects tested on multiple operating systems.
  • Better error message when using an invalid access token.
  • Fix desktop notifications using libnotify (Linux/BSD).
  • travis branches preserves branch name when displaying Pull Request builds.
  • Addtravis setup modulus.
  • Ruby library now supports build annotations.
  • Document plugin support.
  • Do not have the client raise on unknown API entities.
  • Do not try and resolve missing commit data (as it will lead to a 404).

1.6.6 (December 16, 2013)

  • Fixtravis login --com for new users.

1.6.5 (December 16, 2013)

  • Addtravis settings command for accessing repository settings.
  • Addtravis setup opsworks.
  • Addtravis console -x to run a line of Ruby code with a valid session.
  • Add authentication and streaming example for Ruby library.
  • Add Ruby API for dealing with repository settings.
  • Improvetravis login andtravis login --auto. Add ability to load GitHub token from Keychain.
  • Only ask for GitHub two-factor auth token if two-factor auth is actually required.
  • Fix access right check fortravis caches.

1.6.4 (December 16, 2013)

Release was yanked. See 1.6.5 for changes.

1.6.3 (November 27, 2013)

  • Fix OS detection on Windows.
  • Addtravis repos command.
  • Addtravis setup cloudfiles.
  • Addtravis setup divshot.
  • Add--date flag totravis history.
  • Add upload and target directory options totravis setup s3.
  • Include commit message in desktop notifications.
  • Check if Notification Center or Growl is actually running before sending out notifications.
  • Better documentation for desktop notifications.
  • Improved handling of pusher errors when streaming.
  • Add ability to load archived logs from different host.
  • User proper API endpoint for streaming logs, as old endpoint has been removed.
  • Make tests run on Rubinius 2.x.

1.6.2 (November 8, 2013)

  • Remove worker support, as API endpoints have been removed from Travis CI.
  • Improve OS detection.
  • Fixtravis report.
  • Fix issues with new payload for permissions endpoint (used bytravis monitor).
  • Improve default logic for whethertravis monitor should display desktop notifications.
  • Make desktop notifications work on Mac OSX 10.9.
  • Increase and improve debug output.
  • Only load pry if console command is actually invoked, not when it is loaded (for instance bytravis help).

1.6.1 (November 4, 2013)

  • Update autocompletion when updating travis gem.

1.6.0 (November 4, 2013)

  • Addtravis cache to list and delete directory caches.
  • Addtravis report to give a report of the system, endpoint, configuration and last exception.
  • AddCache entity.
  • Keeptravis monitor running on API errors.

1.5.8 (October 24, 2013)

  • Fix bug in completion code that stopped command line client from running.

1.5.7 (October 24, 2013)

  • Improve logic for automatically figuring out a repository slug based on the tracked git remote.
  • Display error if argument passed to-r is not a full slug.
  • Do not automatically install shell completion on gem installation.
  • Add Travis CI mascot as logo to desktop notifications.
  • Improve OSX and Growl notifications.
  • Require user to be logged in for all commands issued against an enterprise installation.
  • Improve error message when not logged in for enterprise installations.
  • Fix API endpoint detection for enterprise installations.
  • Make streaming API, and thus themonitor andlogs command, work with enterprise installations.
  • Add--build,--push and--pull flags to monitor command to allow filtering events.

1.5.6 (October 22, 2013)

  • Addtravis setup appfog andtravis setup s3.
  • Use new API for fetching a single branch for Repository#branch. This also circumvents the 25 branches limit.
  • Start publishing gem prereleases after successful builds.
  • Havetravis logs display first job for a build if a build number is given (or for the last build if called without arguments)
  • Add support for branch names totravis logs.
  • Add support for just using the job suffix withtravis logs.
  • Improve error message if job cannot be found/identified bytravis logs.
  • Addtravis logout for removing access token.
  • Improve error message for commands that require user to be logged in.
  • Addaccount method for fetching a single account toTravis::Client::Methods.
  • Allow creating account objects for any account, not just these the user is part of. AddAccount#member? to check for membership.
  • AddAccount#repositories to load all repos for a given account.
  • AddRepository#owner_name andRepository#owner to load the account owning a repository.
  • AddRepository#member? to check if the current user is a member of a repository.
  • AddBuild#pull_request_number andBuild#pull_request_title.
  • Remove trailing new lines from string passed totravis encrypt.
  • Fix doubleprovider entry generated bytravis setup engineyard.
  • Only load auto-completions if available.
  • Fix and improve growl notifications.
  • Fix GitHub host detectiontravis login --auto.
  • API endpoint may now include a path all the requests will be prefixed with.
  • Allow overriding SSL options in Ruby client.
  • Add--insecure to turn off SSL verification.
  • Add--enterprise/-X option for Travis Enterprise integration.

1.5.5 (October 2, 2013)

  • Addtravis setup pypi
  • Addtravis setup npm
  • When loading accounts, set all flag to true.
  • Fix bug where session.config would be nil instead of a hash.

1.5.4 (September 7, 2013)

  • Maketravis monitor send out desktop notifications.
  • List available templates ontravis init --help.
  • List available services ontravis setup --help.
  • Maketravis setup cloudfoundry detect the target automatically if possible
  • Havetravis setup ask if you want to deploy/release from current branch if not on master.
  • Give autocompletion on zshsuperpowers.
  • AddRepository#github_language.
  • travis init now is smarter when it comes to detecting the template to use (ie, "CoffeeScript" will be mapped to "node_js")
  • Runningtravis init without a language will now useRepository#github_language as default language rather than ruby.
  • Maketravis login andtravis login --auto work with GitHub Enterprise.
  • Maketravis login work with two factor authentication.
  • Addtravis endpoint --github.
  • Maketravis accounts handle accounts without name better.

1.5.3 (August 22, 2013)

  • Fix issues on Windows.
  • Improvetravis setup rubygems (automatically figure out API token for newer RubyGems versions, offer to only release tagged commits, allow changing gem name).
  • Add command descriptions to help pages.
  • Smarter check if travis gem is outdated.
  • Better error messages for non-existing build/job numbers.

1.5.2 (August 18, 2013)

  • Addtravis cancel.
  • AddBuild#cancel andJob#cancel to Ruby API.
  • Addtravis setup cloudfoundry.
  • Add--set-default and--drop-default totravis endpoint.
  • Make it possible to configure cli via env variables ($TRAVIS_TOKEN,$TRAVIS_ENDPOINT and$TRAVIS_CONFIG_PATH).
  • Improvetravis setup cloudcontrol.

1.5.1 (August 15, 2013)

  • Addtravis setup engineyard.
  • Addtravis setup cloudcontrol.
  • Silence warnings when runningtravis help ortravis console.

1.5.0 (August 7, 2013)

  • Addtravis setup rubygems.
  • Addtravis accounts.
  • Addtravis monitor.
  • Maketravis logs stream.
  • Add Broadcast entity.
  • Add streaming body API.
  • Add event listener API.
  • Add simple plugin system (will load any ~/.travis/*/init.rb when running cli).
  • Implement shell completion for bash and zsh.
  • Be smarter about warnings when runningtravis encrypt.
  • Improve documentation.

1.4.0 (July 26, 2013)

  • Addtravis init
  • Improve install documentation, especially for people from outside the Ruby community
  • Improve error message on an expired token
  • Add Account entity to library
  • Switch to Typhoeus as default HTTP adapter
  • Fix tests for forks

1.3.1 (July 21, 2013)

  • Addtravis whatsup --my-repos, which corresponds to the "My Repositories" tab in the web interface
  • It is now recommended to use Ruby 2.0, any Ruby version prior to 1.9.3 will lead to a warning being displayed. Disable with--skip-version-check.
  • Add--override and--append totravis encrypt, make default behavior depend on key.
  • Add shorthand fortravis encrypt --add.

1.3.0 (July 20, 2013)

  • Addtravis setup [heroku|openshift|nodejitsu|sauce_connect]
  • Addtravis branches
  • Add Repository#branch and Repository#branches
  • Improve--help
  • Improve error message when callingtravis logs with a matrix build number
  • Check if travis gem is up to date from time to time (CLI only, not when used as library)

1.2.8 (July 19, 2013)

  • Make pubkey print out key in ssh encoding, add --pem flag for old format
  • Fix more encoding issues
  • Fix edge cases that broke history view

1.2.7 (July 15, 2013)

  • Add pubkey command
  • Remove all whitespace from an encrypted string

v1.2.6 (July 7, 2013)

  • Improve output of history command

v1.2.5 (July 7, 2013)

  • Fix encoding issue

v1.2.4 (July 7, 2013)

  • Allow empty commit message

v1.2.3 (June 27, 2013)

  • Fix encoding issue
  • Will detect github repo from other remotes besides origin
  • Add clear_cache(!) to Travis::Namespace

v1.2.2 (May 24, 2013)

  • Fixedtravis disable.
  • Fix edge cases aroundtravis encrypt.

v1.2.1 (May 24, 2013)

  • Builds with high build numbers are properly aligned when runningtravis history.
  • Don't lock against a specific backports version, makes it easier to use it as a Ruby library.
  • Fix encoding issues.

v1.2.0 (February 22, 2013)

  • add--adapter to API endpoints
  • added branch toshow
  • fix bug where colors were not used if stdin is a pipe
  • makeencrypt options--split and--add work together properly
  • better handling of missing or empty.travis.yml when runningencrypt --add
  • fix broken example code
  • no longer require network connection to automatically detect repository slug
  • add worker support to the ruby library
  • adjust artifacts/logs code to upstream api changes

v1.1.3 (January 26, 2013)

  • use persistent HTTP connections (performance for commands with example api requests)
  • include round trip time in debug output

v1.1.2 (January 24, 2013)

  • token command
  • no longer wrap $stdin in delegator (caused bug on some Linux systems)
  • correctly detect when running on Windows, even on JRuby

v1.1.1 (January 22, 2013)

  • Make pry a runtime dependency rather than a development dependency.

v1.1.0 (January 21, 2013)

  • New commands:console,status,show,logs,history,restart,sync,enable,disable,open andwhatsup.
  • --debug option for all API commands.
  • --split option forencrypt.
  • Fix--add option forencrypt (was naming keysecret instead ofsecure).
  • First class representation for builds, commits and jobs in the Ruby library.
  • Print warning when running "encrypt owner/project data", as it's not supported by the new client.
  • Improved documentation.

v1.0.3 (January 15, 2013)

  • Fix-r slug for repository commands. (#3)

v1.0.2 (January 14, 2013)

  • Only bundle CA certs needed to verify Travis CI and GitHub domains.
  • Make tests pass on Windows.

v1.0.1 (January 14, 2013)

  • Improveencrypt --add behavior.

v1.0.0 (January 14, 2013)

  • Fist public release.
  • Improved documentation.

v1.0.0pre2 (January 14, 2013)

  • Added Windows support.
  • Suggestion to runtravis login will add--org if needed.

v1.0.0pre (January 13, 2013)

  • Initial public prerelease.

[8]ページ先頭

©2009-2025 Movatter.jp