travis-async-listener 1.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +22 -0
  3. data/README.md +2486 -0
  4. data/Rakefile +63 -0
  5. data/assets/cacert.pem +69 -0
  6. data/assets/init/c.yml +4 -0
  7. data/assets/init/clojure.yml +1 -0
  8. data/assets/init/cpp.yml +4 -0
  9. data/assets/init/erlang.yml +3 -0
  10. data/assets/init/go.yml +4 -0
  11. data/assets/init/groovy.yml +1 -0
  12. data/assets/init/haskell.yml +1 -0
  13. data/assets/init/java.yml +4 -0
  14. data/assets/init/node_js.yml +4 -0
  15. data/assets/init/objective-c.yml +1 -0
  16. data/assets/init/perl.yml +4 -0
  17. data/assets/init/php.yml +4 -0
  18. data/assets/init/python.yml +5 -0
  19. data/assets/init/ruby.yml +6 -0
  20. data/assets/init/scala.yml +4 -0
  21. data/assets/notifications/Travis CI.app/Contents/Info.plist +52 -0
  22. data/assets/notifications/Travis CI.app/Contents/MacOS/Travis CI +0 -0
  23. data/assets/notifications/Travis CI.app/Contents/PkgInfo +1 -0
  24. data/assets/notifications/Travis CI.app/Contents/Resources/Travis CI.icns +0 -0
  25. data/assets/notifications/Travis CI.app/Contents/Resources/en.lproj/Credits.rtf +29 -0
  26. data/assets/notifications/Travis CI.app/Contents/Resources/en.lproj/InfoPlist.strings +0 -0
  27. data/assets/notifications/Travis CI.app/Contents/Resources/en.lproj/MainMenu.nib +0 -0
  28. data/assets/notifications/Travis CI.app/Contents/_CodeSignature/CodeResources +173 -0
  29. data/assets/notifications/Travis CI.app/Contents/embedded.provisionprofile +0 -0
  30. data/assets/notifications/icon.png +0 -0
  31. data/assets/travis.sh +163 -0
  32. data/assets/travis.sh.erb +64 -0
  33. data/bin/travis +18 -0
  34. data/examples/org_overview.rb +3 -0
  35. data/examples/pro_auth.rb +23 -0
  36. data/examples/stream.rb +6 -0
  37. data/lib/travis.rb +8 -0
  38. data/lib/travis/auto_login.rb +3 -0
  39. data/lib/travis/cli.rb +126 -0
  40. data/lib/travis/cli/accounts.rb +31 -0
  41. data/lib/travis/cli/api_command.rb +180 -0
  42. data/lib/travis/cli/branches.rb +25 -0
  43. data/lib/travis/cli/cache.rb +76 -0
  44. data/lib/travis/cli/cancel.rb +18 -0
  45. data/lib/travis/cli/command.rb +422 -0
  46. data/lib/travis/cli/console.rb +31 -0
  47. data/lib/travis/cli/disable.rb +15 -0
  48. data/lib/travis/cli/enable.rb +31 -0
  49. data/lib/travis/cli/encrypt.rb +108 -0
  50. data/lib/travis/cli/encrypt_file.rb +140 -0
  51. data/lib/travis/cli/endpoint.rb +35 -0
  52. data/lib/travis/cli/env.rb +66 -0
  53. data/lib/travis/cli/help.rb +23 -0
  54. data/lib/travis/cli/history.rb +49 -0
  55. data/lib/travis/cli/init.rb +82 -0
  56. data/lib/travis/cli/lint.rb +49 -0
  57. data/lib/travis/cli/login.rb +76 -0
  58. data/lib/travis/cli/logout.rb +14 -0
  59. data/lib/travis/cli/logs.rb +65 -0
  60. data/lib/travis/cli/monitor.rb +110 -0
  61. data/lib/travis/cli/open.rb +39 -0
  62. data/lib/travis/cli/parser.rb +43 -0
  63. data/lib/travis/cli/pubkey.rb +30 -0
  64. data/lib/travis/cli/raw.rb +20 -0
  65. data/lib/travis/cli/repo_command.rb +154 -0
  66. data/lib/travis/cli/report.rb +101 -0
  67. data/lib/travis/cli/repos.rb +53 -0
  68. data/lib/travis/cli/requests.rb +47 -0
  69. data/lib/travis/cli/restart.rb +18 -0
  70. data/lib/travis/cli/settings.rb +77 -0
  71. data/lib/travis/cli/setup.rb +66 -0
  72. data/lib/travis/cli/setup/anynines.rb +21 -0
  73. data/lib/travis/cli/setup/appfog.rb +19 -0
  74. data/lib/travis/cli/setup/artifacts.rb +23 -0
  75. data/lib/travis/cli/setup/biicode.rb +19 -0
  76. data/lib/travis/cli/setup/cloud_66.rb +20 -0
  77. data/lib/travis/cli/setup/cloud_control.rb +21 -0
  78. data/lib/travis/cli/setup/cloud_files.rb +20 -0
  79. data/lib/travis/cli/setup/cloud_foundry.rb +23 -0
  80. data/lib/travis/cli/setup/code_deploy.rb +55 -0
  81. data/lib/travis/cli/setup/deis.rb +20 -0
  82. data/lib/travis/cli/setup/divshot.rb +18 -0
  83. data/lib/travis/cli/setup/elastic_beanstalk.rb +23 -0
  84. data/lib/travis/cli/setup/engine_yard.rb +24 -0
  85. data/lib/travis/cli/setup/gcs.rb +22 -0
  86. data/lib/travis/cli/setup/hackage.rb +18 -0
  87. data/lib/travis/cli/setup/heroku.rb +20 -0
  88. data/lib/travis/cli/setup/modulus.rb +18 -0
  89. data/lib/travis/cli/setup/ninefold.rb +20 -0
  90. data/lib/travis/cli/setup/nodejitsu.rb +27 -0
  91. data/lib/travis/cli/setup/npm.rb +20 -0
  92. data/lib/travis/cli/setup/open_shift.rb +20 -0
  93. data/lib/travis/cli/setup/opsworks.rb +22 -0
  94. data/lib/travis/cli/setup/pypi.rb +22 -0
  95. data/lib/travis/cli/setup/releases.rb +35 -0
  96. data/lib/travis/cli/setup/ruby_gems.rb +25 -0
  97. data/lib/travis/cli/setup/s3.rb +25 -0
  98. data/lib/travis/cli/setup/sauce_connect.rb +21 -0
  99. data/lib/travis/cli/setup/service.rb +73 -0
  100. data/lib/travis/cli/show.rb +69 -0
  101. data/lib/travis/cli/sshkey.rb +118 -0
  102. data/lib/travis/cli/status.rb +19 -0
  103. data/lib/travis/cli/sync.rb +30 -0
  104. data/lib/travis/cli/token.rb +14 -0
  105. data/lib/travis/cli/version.rb +17 -0
  106. data/lib/travis/cli/whatsup.rb +30 -0
  107. data/lib/travis/cli/whoami.rb +15 -0
  108. data/lib/travis/client.rb +39 -0
  109. data/lib/travis/client/account.rb +56 -0
  110. data/lib/travis/client/annotation.rb +21 -0
  111. data/lib/travis/client/artifact.rb +88 -0
  112. data/lib/travis/client/auto_login.rb +45 -0
  113. data/lib/travis/client/broadcast.rb +14 -0
  114. data/lib/travis/client/build.rb +47 -0
  115. data/lib/travis/client/cache.rb +25 -0
  116. data/lib/travis/client/commit.rb +28 -0
  117. data/lib/travis/client/entity.rb +238 -0
  118. data/lib/travis/client/env_var.rb +102 -0
  119. data/lib/travis/client/error.rb +38 -0
  120. data/lib/travis/client/has_uuid.rb +13 -0
  121. data/lib/travis/client/job.rb +61 -0
  122. data/lib/travis/client/lint_result.rb +25 -0
  123. data/lib/travis/client/listener.rb +184 -0
  124. data/lib/travis/client/methods.rb +104 -0
  125. data/lib/travis/client/namespace.rb +85 -0
  126. data/lib/travis/client/not_loadable.rb +13 -0
  127. data/lib/travis/client/repository.rb +224 -0
  128. data/lib/travis/client/request.rb +36 -0
  129. data/lib/travis/client/restartable.rb +23 -0
  130. data/lib/travis/client/session.rb +339 -0
  131. data/lib/travis/client/settings.rb +25 -0
  132. data/lib/travis/client/singleton_setting.rb +36 -0
  133. data/lib/travis/client/ssh_key.rb +11 -0
  134. data/lib/travis/client/states.rb +98 -0
  135. data/lib/travis/client/user.rb +67 -0
  136. data/lib/travis/client/weak_entity.rb +26 -0
  137. data/lib/travis/pro.rb +5 -0
  138. data/lib/travis/pro/auto_login.rb +3 -0
  139. data/lib/travis/tools/assets.rb +21 -0
  140. data/lib/travis/tools/completion.rb +54 -0
  141. data/lib/travis/tools/formatter.rb +50 -0
  142. data/lib/travis/tools/github.rb +279 -0
  143. data/lib/travis/tools/notification.rb +69 -0
  144. data/lib/travis/tools/safe_string.rb +22 -0
  145. data/lib/travis/tools/ssl_key.rb +48 -0
  146. data/lib/travis/tools/system.rb +88 -0
  147. data/lib/travis/version.rb +3 -0
  148. data/spec/cli/cancel_spec.rb +15 -0
  149. data/spec/cli/encrypt_spec.rb +43 -0
  150. data/spec/cli/endpoint_spec.rb +34 -0
  151. data/spec/cli/help_spec.rb +33 -0
  152. data/spec/cli/history_spec.rb +38 -0
  153. data/spec/cli/init_spec.rb +226 -0
  154. data/spec/cli/login_spec.rb +13 -0
  155. data/spec/cli/logs_spec.rb +8 -0
  156. data/spec/cli/open_spec.rb +33 -0
  157. data/spec/cli/repo_command_spec.rb +25 -0
  158. data/spec/cli/restart_spec.rb +15 -0
  159. data/spec/cli/setup_spec.rb +5 -0
  160. data/spec/cli/show_spec.rb +9 -0
  161. data/spec/cli/status_spec.rb +28 -0
  162. data/spec/cli/token_spec.rb +22 -0
  163. data/spec/cli/version_spec.rb +18 -0
  164. data/spec/cli/whoami_spec.rb +34 -0
  165. data/spec/client/account_spec.rb +32 -0
  166. data/spec/client/annotation_spec.rb +14 -0
  167. data/spec/client/broadcast_spec.rb +10 -0
  168. data/spec/client/build_spec.rb +31 -0
  169. data/spec/client/commit_spec.rb +22 -0
  170. data/spec/client/job_spec.rb +30 -0
  171. data/spec/client/methods_spec.rb +15 -0
  172. data/spec/client/namespace_spec.rb +19 -0
  173. data/spec/client/repository_spec.rb +39 -0
  174. data/spec/client/session_spec.rb +165 -0
  175. data/spec/client/user_spec.rb +16 -0
  176. data/spec/client_spec.rb +17 -0
  177. data/spec/pro_spec.rb +10 -0
  178. data/spec/spec_helper.rb +29 -0
  179. data/spec/support/fake_api.rb +738 -0
  180. data/spec/support/fake_github.rb +24 -0
  181. data/spec/support/helpers.rb +45 -0
  182. data/spec/travis_spec.rb +10 -0
  183. data/travis.gemspec +323 -0
  184. metadata +489 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c2c971afeb350bb4a953d52e3ddcdccb1411c0fa
4
+ data.tar.gz: 16c9184f600c60861d035bce8e5ecaa2d1e42e0b
5
+ SHA512:
6
+ metadata.gz: 5046335bf8d874f563c657207f71fd778e12046e92cf511523d44e39d5f093e86cf5611cdb5bc70b9e0f3f2b2a9a474eb15f05f17a1d2cfd5fefa4160c9d5397
7
+ data.tar.gz: 5c32ed8a51bd2fb53950519713693462698a64eedc3182d1c34860f6deeceb33ec59c9ae9d75ced31eb9a1680a0d4d5f752ac1d612f1505e52da501e3772d432
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT LICENSE
2
+
3
+ Copyright (c) 2014 Travis CI GmbH <support@travis-ci.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
@@ -0,0 +1,2486 @@
1
+ # The Travis Client [![Build Status](https://travis-ci.org/travis-ci/travis.rb.svg?branch=master)](https://travis-ci.org/travis-ci/travis.rb)
2
+
3
+ ![The Travis Mascot](http://about.travis-ci.org/images/travis-mascot-200px.png)
4
+
5
+ The [travis gem](https://rubygems.org/gems/travis) includes both a [command line client](#command-line-client) and a [Ruby library](#ruby-library) to interface with a Travis CI service. Both work with [travis-ci.org](https://travis-ci.org), [travis-ci.com](https://travis-ci.com) or any custom Travis CI setup you might have. Check out the [installation instructions](#installation) to get it running in no time.
6
+
7
+ ## Table of Contents
8
+
9
+ * [Command Line Client](#command-line-client)
10
+ * [Non-API Commands](#non-api-commands)
11
+ * [`help`](#help) - helps you out when in dire need of information
12
+ * [`version`](#version) - outputs the client version
13
+ * [General API Commands](#general-api-commands)
14
+ * [`accounts`](#accounts) - displays accounts and their subscription status
15
+ * [`console`](#console) - interactive shell
16
+ * [`endpoint`](#endpoint) - displays or changes the API endpoint
17
+ * [`login`](#login) - authenticates against the API and stores the token
18
+ * [`monitor`](#monitor) - live monitor for what's going on
19
+ * [`raw`](#raw) - makes an (authenticated) API call and prints out the result
20
+ * [`report`](#report) - generates a report useful for filing issues
21
+ * [`repos`](#repos) - lists repositories the user has certain permissions on
22
+ * [`sync`](#sync) - triggers a new sync with GitHub
23
+ * [`lint`](#lint) - display warnings for a .travis.yml
24
+ * [`token`](#token) - outputs the secret API token
25
+ * [`whatsup`](#whatsup) - lists most recent builds
26
+ * [`whoami`](#whoami) - outputs the current user
27
+ * [Repository Commands](#repository-commands)
28
+ * [`branches`](#branches) - displays the most recent build for each branch
29
+ * [`cache`](#cache) - lists or deletes repository caches
30
+ * [`cancel`](#cancel) - cancels a job or build
31
+ * [`disable`](#disable) - disables a project
32
+ * [`enable`](#enable) - enables a project
33
+ * [`encrypt`](#encrypt) - encrypts values for the .travis.yml
34
+ * [`encrypt-file`](#encrypt-file) - encrypts a file and adds decryption steps to .travis.yml
35
+ * [`env`](#env) - show or modify build environment variables
36
+ * [`history`](#history) - displays a projects build history
37
+ * [`init`](#init) - generates a .travis.yml and enables the project
38
+ * [`logs`](#logs) - streams test logs
39
+ * [`open`](#open) - opens a build or job in the browser
40
+ * [`pubkey`](#pubkey) - prints out a repository's public key
41
+ * [`requests`](#requests) - lists recent requests
42
+ * [`restart`](#restart) - restarts a build or job
43
+ * [`settings`](#settings) - access repository settings
44
+ * [`setup`](#setup) - sets up an addon or deploy target
45
+ * [`show`](#show) - displays a build or job
46
+ * [`sshkey`](#sshkey) - checks, updates or deletes an SSH key
47
+ * [`status`](#status) - checks status of the latest build
48
+ * [Pro and Enterprise](#pro-and-enterprise)
49
+ * [Environment Variables](#environment-variables)
50
+ * [Desktop Notifications](#desktop-notifications)
51
+ * [Plugins](#plugins)
52
+ * [Official Plugins](#official-plugins)
53
+ * [Ruby Library](#ruby-library)
54
+ * [Authentication](#authentication)
55
+ * [Using Pro](#using-pro)
56
+ * [Entities](#entities)
57
+ * [Stateful Entities](#stateful-entities)
58
+ * [Repositories](#repositories)
59
+ * [Builds](#builds)
60
+ * [Jobs](#jobs)
61
+ * [Artifacts](#artifacts)
62
+ * [Users](#users)
63
+ * [Commits](#commits)
64
+ * [Caches](#caches)
65
+ * [Repository Settings](#repository-settings)
66
+ * [Build Environment Variables](#build-environment-variables)
67
+ * [Listening for Events](#listening-for-events)
68
+ * [Dealing with Sessions](#dealing-with-sessions)
69
+ * [Using Namespaces](#using-namespaces)
70
+ * [Installation](#installation)
71
+ * [Updating your Ruby](#updating-your-ruby)
72
+ * [Mac OS X via Homebrew](#mac-os-x-via-homebrew)
73
+ * [Windows](#windows)
74
+ * [Other Unix systems](#other-unix-systems)
75
+ * [Ruby versioning tools](#ruby-versioning-tools)
76
+ * [Troubleshooting](#troubleshooting)
77
+ * [Ubuntu](#ubuntu)
78
+ * [Mac OS X](#mac-os-x)
79
+ * [Upgrading from travis-cli](#upgrading-from-travis-cli)
80
+ * [Version History](#version-history)
81
+
82
+ ## Command Line Client
83
+
84
+ ![](http://about.travis-ci.org/images/new-tricks.png)
85
+
86
+ There are three types of commands: [Non-API Commands](#non-api-commands), [General API Commands](#general-api-commands) and [Repository Commands](#repository-commands). All commands take the form of `travis COMMAND [ARGUMENTS] [OPTIONS]`. You can get a list of commands by running [`help`](#help).
87
+
88
+ ### Non-API Commands
89
+
90
+ Every Travis command takes three global options:
91
+
92
+ -h, --help Display help
93
+ -i, --[no-]interactive be interactive and colorful
94
+ -E, --[no-]explode don't rescue exceptions
95
+
96
+ The `--help` option is equivalent to running `travis help COMMAND`.
97
+
98
+ The `--interactive` options determines wether 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.
99
+
100
+ 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.
101
+
102
+ #### `help`
103
+
104
+ The `help` command will inform you about the arguments and options that the commands take, for instance:
105
+
106
+ ``` console
107
+ $ travis help help
108
+ Usage: travis help [command] [options]
109
+ -h, --help Display help
110
+ -i, --[no-]interactive be interactive and colorful
111
+ -E, --[no-]explode don't rescue exceptions
112
+ ```
113
+
114
+ Running `help` without a command name will give you a list of all available commands.
115
+
116
+ #### `version`
117
+
118
+ As you might have guessed, this command prints out the client's version.
119
+
120
+ ### General API Commands
121
+
122
+ API commands inherit all options from [Non-API Commands](#non-api-commands).
123
+
124
+ Additionally, every API command understands the following options:
125
+
126
+ -e, --api-endpoint URL Travis API server to talk to
127
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
128
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
129
+ -t, --token [ACCESS_TOKEN] access token to use
130
+ --debug show API requests
131
+ --adapter ADAPTER Faraday adapter to use for HTTP requests
132
+
133
+ 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 a [`travis login`](#login).
134
+
135
+ The `--debug` option will print HTTP requests to STDERR. Like `--explode`, this is really helpful when contributing to this project.
136
+
137
+ There are many libraries out there to do HTTP requests in Ruby. You can switch amongst common ones with `--adapter`:
138
+
139
+ ``` console
140
+ $ travis show --adapter net-http
141
+ ...
142
+ $ gem install excon
143
+ ...
144
+ $ travis show --adapter excon
145
+ ...
146
+ ```
147
+
148
+ #### `accounts`
149
+
150
+ The accounts command can be used to list all the accounts you can set up repositories for.
151
+
152
+ ``` console
153
+ $ travis accounts
154
+ rkh (Konstantin Haase): subscribed, 160 repositories
155
+ sinatra (Sinatra): subscribed, 9 repositories
156
+ rack (Official Rack repositories): subscribed, 3 repositories
157
+ travis-ci (Travis CI): subscribed, 57 repositories
158
+ ...
159
+ ```
160
+
161
+ #### `console`
162
+
163
+ Running `travis console` gives you an interactive Ruby session with all the [entities](#entities) imported into global namespace.
164
+
165
+ But why use this over just `irb -r travis`? For one, it will take care of authentication, setting the correct endpoint, etc, and it also allows you to pass in `--debug` if you are curious as to what's actually going on.
166
+
167
+ ``` console
168
+ $ travis console
169
+ >> User.current
170
+ => #<User: rkh>
171
+ >> Repository.find('sinatra/sinatra')
172
+ => #<Repository: sinatra/sinatra>
173
+ >> _.last_build
174
+ => #<Travis::Client::Build: sinatra/sinatra#360>
175
+ ```
176
+
177
+ #### `endpoint`
178
+
179
+ Prints out the API endpoint you're talking to.
180
+
181
+ ``` console
182
+ $ travis endpoint
183
+ API endpoint: https://api.travis-ci.org/
184
+ ```
185
+
186
+ Handy for using it when working with shell scripts:
187
+
188
+ ``` console
189
+ $ curl "$(travis endpoint)/docs" > docs.html
190
+ ```
191
+
192
+ It can also be used to set the default API endpoint used for [General API Commands](#general-api-commands):
193
+
194
+ ``` console
195
+ $ travis endpoint --pro --set-default
196
+ API endpoint: https://api.travis-ci.com/ (stored as default)
197
+ ```
198
+
199
+ You can use `--drop-default` to remove the setting again:
200
+
201
+ ``` console
202
+ $ travis endpoint --drop-default
203
+ default API endpoint dropped (was https://api.travis-ci.com/)
204
+ ```
205
+
206
+ #### `login`
207
+
208
+ The `login` command will, well, log you in. That way, all subsequent commands that run against the same endpoint will be authenticated.
209
+
210
+ ``` console
211
+ $ travis login
212
+ We need your GitHub login to identify you.
213
+ This information will not be sent to Travis CI, only to GitHub.
214
+ The password will not be displayed.
215
+
216
+ Try running with --github-token or --auto if you don't want to enter your password anyway.
217
+
218
+ Username: rkh
219
+ Password: *******************
220
+
221
+ Successfully logged in!
222
+ ```
223
+
224
+ As you can see above, it will ask you for your GitHub user name and password, but not send these to Travis CI. Instead, it will use them to create a GitHub API token, show the token to Travis, which then on its own checks if you really are who you say you are, and gives you an access token for the Travis API in return. The client will then delete the GitHub token again, just to be sure. But don't worry, all that happens under the hood and fully automatic.
225
+
226
+ If you don't want it to send your credentials to GitHub, you can create a GitHub token on your own and supply it via `--github-token`. In that case, the client will not delete the GitHub token (as it can't, it needs your password to do this). Travis CI will not store the token, though - after all, it already should have a valid token for you in the database.
227
+
228
+ 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 a [global GitHub token](https://help.github.com/articles/git-over-https-using-oauth-token) stored in your [.netrc](http://blogdown.io/c4d42f87-80dd-45d5-8927-4299cbdf261c/posts/574baa68-f663-4dcf-88b9-9d41310baf2f). If you haven't heard of this, it's worth looking into in general. Again: Travis CI will not store that token.
229
+
230
+ #### `logout`
231
+
232
+ This command makes Travis CI forget your access token.
233
+
234
+ ``` console
235
+ $ travis logout --pro
236
+ Successfully logged out!
237
+ ```
238
+
239
+ #### `monitor`
240
+
241
+ Usage: travis monitor [options]
242
+ -h, --help Display help
243
+ -i, --[no-]interactive be interactive and colorful
244
+ -E, --[no-]explode don't rescue exceptions
245
+ --skip-version-check don't check if travis client is up to date
246
+ -e, --api-endpoint URL Travis API server to talk to
247
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
248
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
249
+ -t, --token [ACCESS_TOKEN] access token to use
250
+ --debug show API requests
251
+ -X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
252
+ -m, --my-repos Only monitor my own repositories
253
+ -r, --repo SLUG monitor given repository (can be used more than once)
254
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
255
+ -n, --[no-]notify [TYPE] send out desktop notifications (optional type: osx, growl, libnotify)
256
+ -b, --builds only monitor builds, not jobs
257
+ -p, --push monitor push events
258
+ -P, --pull monitor pull request events
259
+
260
+ With `monitor` you can watch a live stream of what's going on:
261
+
262
+ ``` console
263
+ $ travis monitor
264
+ Monitoring travis-ci.org:
265
+ 2013-08-05 01:22:40 questmaster/FATpRemote#45 started
266
+ 2013-08-05 01:22:40 questmaster/FATpRemote#45.1 started
267
+ 2013-08-05 01:22:41 grangier/python-goose#33.1 passed
268
+ 2013-08-05 01:22:42 plataformatec/simple_form#666 passed
269
+ ...
270
+ ```
271
+
272
+ You can limit it to a single repository via `--repo SLUG`.
273
+
274
+ By default, you will receive events for both builds and jobs, you can limit it to builds only via `--build` (short `-b`):
275
+
276
+ ``` console
277
+ $ travis monitor
278
+ Monitoring travis-ci.org:
279
+ 2013-08-05 01:22:40 questmaster/FATpRemote#45 started
280
+ 2013-08-05 01:22:42 plataformatec/simple_form#666 passed
281
+ ...
282
+ ```
283
+
284
+ Similarly, you can limit it to builds/jobs for pull requests via `--pull` and for normal pushes via `--push`.
285
+
286
+ The monitor command can also send out [desktop notifications](#desktop-notifications):
287
+
288
+ ``` console
289
+ $ travis monitor --pro -n
290
+ Monitoring travis-ci.com:
291
+ ...
292
+ ```
293
+
294
+ When monitoring specific repositories, notifications will be turned on by default. Disable with `--no-notify`.
295
+
296
+ #### `raw`
297
+
298
+ This is really helpful both when working on this client and when exploring the [Travis API](https://api.travis-ci.org). 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:
299
+
300
+ ``` console
301
+ $ travis raw /repos/travis-ci/travis.rb
302
+ {"repo"=>
303
+ {"id"=>409371,
304
+ "slug"=>"travis-ci/travis.rb",
305
+ "description"=>"Travis CI Client (CLI and Ruby library)",
306
+ "last_build_id"=>4251410,
307
+ "last_build_number"=>"77",
308
+ "last_build_state"=>"passed",
309
+ "last_build_duration"=>351,
310
+ "last_build_language"=>nil,
311
+ "last_build_started_at"=>"2013-01-19T18:00:49Z",
312
+ "last_build_finished_at"=>"2013-01-19T18:02:17Z"}}
313
+ ```
314
+
315
+ Use `--json` if you'd rather prefer the output to be JSON.
316
+
317
+ #### `report`
318
+
319
+ 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.
320
+
321
+ ``` console
322
+ $ travis report --pro
323
+ System
324
+ Ruby: Ruby 2.0.0-p195
325
+ Operating System: Mac OS X 10.8.5
326
+ RubyGems: RubyGems 2.0.7
327
+
328
+ CLI
329
+ Version: 1.5.8
330
+ Plugins: "travis-as-user", "travis-build", "travis-cli-pr"
331
+ Auto-Completion: yes
332
+ Last Version Check: 2013-11-02 16:25:03 +0100
333
+
334
+ Session
335
+ API Endpoint: https://api.travis-ci.com/
336
+ Logged In: as "rkh"
337
+ Verify SSL: yes
338
+ Enterprise: no
339
+
340
+ Endpoints
341
+ pro: https://api.travis-ci.com/ (access token, current)
342
+ org: https://api.travis-ci.org/ (access token)
343
+
344
+ Last Exception
345
+ An error occurred running `travis whoami --pro`:
346
+ Travis::Client::Error: access denied
347
+ from ...
348
+
349
+
350
+ For issues with the command line tool, please visit https://github.com/travis-ci/travis.rb/issues.
351
+ For Travis CI in general, go to https://github.com/travis-ci/travis-ci/issues or email support@travis-ci.com.
352
+ ```
353
+
354
+ This command can also list all known repos and the endpoint to use for them via the `--known-repos` option.
355
+
356
+ #### `repos`
357
+
358
+ Lists repositories the user has certain permissions on.
359
+ Usage: travis repos [options]
360
+ -h, --help Display help
361
+ -i, --[no-]interactive be interactive and colorful
362
+ -E, --[no-]explode don't rescue exceptions
363
+ --skip-version-check don't check if travis client is up to date
364
+ --skip-completion-check don't check if auto-completion is set up
365
+ -e, --api-endpoint URL Travis API server to talk to
366
+ -I, --[no-]insecure do not verify SSL certificate of API endpoint
367
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
368
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
369
+ -t, --token [ACCESS_TOKEN] access token to use
370
+ --debug show API requests
371
+ -X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
372
+ --adapter ADAPTER Faraday adapter to use for HTTP requests
373
+ -m, --match PATTERN only list repositories matching the given pattern (shell style)
374
+ -o, --owner LOGIN only list repos for a certain owner
375
+ -n, --name NAME only list repos with a given name
376
+ -a, --active only list active repositories
377
+ -A, --inactive only list inactive repositories
378
+ -d, --admin only list repos with (or without) admin access
379
+ -D, --no-admin only list repos without admin access
380
+
381
+ Lists repositories and displays whether these are active or not. Has a variety of options to filter repositories.
382
+
383
+ ``` console
384
+ $ travis repos -m 'rkh/travis-*'
385
+ rkh/travis-chat (active: yes, admin: yes, push: yes, pull: yes)
386
+ Description: example app demoing travis-sso usage
387
+
388
+ rkh/travis-encrypt (active: yes, admin: yes, push: yes, pull: yes)
389
+ Description: proof of concept in browser encryption of travis settings
390
+
391
+ rkh/travis-lite (active: no, admin: yes, push: yes, pull: yes)
392
+ Description: Travis CI without the JavaScript
393
+
394
+ rkh/travis-surveillance (active: no, admin: yes, push: yes, pull: yes)
395
+ Description: Veille sur un projet.
396
+ ```
397
+
398
+ In non-interactive mode, it will only output the repository slug, which goes well with xargs:
399
+
400
+ ``` console
401
+ $ travis repos --active --owner travis-ci | xargs -I % travis disable -r %
402
+ travis-ci/artifacts: disabled :(
403
+ travis-ci/canary: disabled :(
404
+ travis-ci/docs-travis-ci-com: disabled :(
405
+ travis-ci/dpl: disabled :(
406
+ travis-ci/gh: disabled :(
407
+ ...
408
+ ```
409
+
410
+ #### `sync`
411
+
412
+ Usage: travis sync [options]
413
+ -h, --help Display help
414
+ -i, --[no-]interactive be interactive and colorful
415
+ -E, --[no-]explode don't rescue exceptions
416
+ -e, --api-endpoint URL Travis API server to talk to
417
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
418
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
419
+ -t, --token [ACCESS_TOKEN] access token to use
420
+ --debug show API requests
421
+ -c, --check only check the sync status
422
+ -b, --background will trigger sync but not block until sync is done
423
+ -f, --force will force sync, even if one is already running
424
+
425
+ Sometimes the infos Travis CI has about users and repositories become out of date. If that should happen, you can manually trigger a sync:
426
+
427
+ ``` console
428
+ $ travis sync
429
+ synchronizing: ........... done
430
+ ```
431
+
432
+ The command blocks until the synchronization is done. You can avoid that with `--background`:
433
+
434
+ ``` console
435
+ $ travis sync --background
436
+ starting synchronization
437
+ ```
438
+
439
+ If you just want to know if your account is being synchronized right now, use `--check`:
440
+
441
+ ``` console
442
+ $ travis sync --check
443
+ rkh is currently syncing
444
+ ```
445
+
446
+ #### `lint`
447
+
448
+ This checks a `.travis.yml` file for any issues it might detect.
449
+
450
+ By default, it will read a file named `.travis.yml` in the current directory:
451
+
452
+ ``` console
453
+ $ travis lint
454
+ Warnings for .travis.yml:
455
+ [x] your repository must be feature flagged for the os setting to be used
456
+ ```
457
+
458
+ You can also give it a path to a different file:
459
+
460
+ ``` console
461
+ $ travis lint example.yml
462
+ ...
463
+ ```
464
+
465
+ Or pipe the content into it:
466
+
467
+ ``` console
468
+ $ echo "foo: bar" | travis lint
469
+ Warnings for STDIN:
470
+ [x] unexpected key foo, dropping
471
+ [x] missing key language, defaulting to ruby
472
+ ```
473
+
474
+ Like the [`status` command](#status), you can use `-q` to suppress any output, and `-x` to have it set the exit code to 1 if there are any warnings.
475
+
476
+ ``` console
477
+ $ travis lint -qx || echo ".travis.yml does not validate"
478
+ ```
479
+
480
+ #### `token`
481
+
482
+ In order to use the Ruby library you will need to obtain an access token first. To do this simply run the `travis login` command. Once logged in you can check your token with `travis token`:
483
+
484
+ ``` console
485
+ $ travis token
486
+ Your access token is super-secret
487
+ ```
488
+
489
+ You can use that token for instance with curl:
490
+
491
+ ``` console
492
+ $ curl -H "Authorization: token $(travis token)" https://api.travis-ci.org/users/
493
+ {"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"}
494
+ ```
495
+
496
+ Note that if you just need it for looking at API payloads, that we also have the [`raw`](#raw) command.
497
+
498
+ #### `whatsup`
499
+
500
+ 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 on [travis-ci.org](https://travis-ci.org)):
501
+
502
+ ``` console
503
+ $ travis whatsup
504
+ mysociety/fixmystreet started: #154
505
+ eloquent/typhoon started: #228
506
+ Pajk/apipie-rails started: #84
507
+ qcubed/framework failed: #21
508
+ ...
509
+ ```
510
+
511
+ If you only want to see what happened in your repositories, add the `--my-repos` flag (short: `-m`):
512
+
513
+ ``` console
514
+ $ travis whatsup -m
515
+ travis-ci/travis.rb passed: #169
516
+ rkh/dpl passed: #50
517
+ rubinius/rubinius passed: #3235
518
+ sinatra/sinatra errored: #619
519
+ rtomayko/tilt failed: #162
520
+ ruby-no-kai/rubykaigi2013 passed: #50
521
+ rack/rack passed: #519
522
+ ...
523
+ ```
524
+
525
+ #### `whoami`
526
+
527
+ This command is useful to verify that you're in fact logged in:
528
+
529
+ ``` console
530
+ $ travis whoami
531
+ You are rkh (Konstantin Haase)
532
+ ```
533
+
534
+ Again, like most other commands, goes well with shell scripting:
535
+
536
+ ``` console
537
+ $ git clone "https://github.com/$(travis whoami)/some_project"
538
+ ```
539
+
540
+ ### Repository Commands
541
+
542
+ -h, --help Display help
543
+ -i, --[no-]interactive be interactive and colorful
544
+ -E, --[no-]explode don't rescue exceptions
545
+ --skip-version-check don't check if travis client is up to date
546
+ --skip-completion-check don't check if auto-completion is set up
547
+ -e, --api-endpoint URL Travis API server to talk to
548
+ -I, --[no-]insecure do not verify SSL certificate of API endpoint
549
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
550
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
551
+ -t, --token [ACCESS_TOKEN] access token to use
552
+ --debug show API requests
553
+ -X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
554
+ -r, --repo SLUG repository to use (will try to detect from current git clone)
555
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
556
+
557
+ Repository commands have all the options [General API Commands](#general-api-commands) have.
558
+
559
+ 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 tracked [git remote](http://www.kernel.org/pub/software/scm/git/docs/git-remote.html) 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.
560
+
561
+ It will also automatically pick [Travis Pro](https://travis-ci.com) if it is a private project. You can of course override this decission with `--pro`, `--org` or `--api-endpoint URL`
562
+
563
+ #### `branches`
564
+
565
+ Displays the most recent build for each branch:
566
+
567
+ ``` console
568
+ $ travis branches
569
+ hh-add-warning-old-style: #35 passed Add a warning if old-style encrypt is being used
570
+ hh-multiline-encrypt: #55 passed Merge branch 'master' into hh-multiline-encrypt
571
+ rkh-show-logs-history: #72 passed regenerate gemspec
572
+ rkh-debug: #75 passed what?
573
+ hh-add-clear-cache-to-global-session: #135 passed Add clear_cache(!) to Travis::Namespace
574
+ hh-annotations: #146 passed Initial annotation support
575
+ hh-remove-newlines-from-encrypted-string: #148 errored Remove all whitespace from an encrypted string
576
+ version-check: #157 passed check travis version for updates from time to time
577
+ master: #163 passed add Repository#branches and Repository#branch(name)
578
+ ```
579
+
580
+ For more fine grained control and older builds on a specific branch, see [`history`](#history).
581
+
582
+ #### `cache`
583
+
584
+ Lists or deletes repository caches.
585
+ Usage: travis cache [options]
586
+ -h, --help Display help
587
+ -i, --[no-]interactive be interactive and colorful
588
+ -E, --[no-]explode don't rescue exceptions
589
+ --skip-version-check don't check if travis client is up to date
590
+ --skip-completion-check don't check if auto-completion is set up
591
+ -e, --api-endpoint URL Travis API server to talk to
592
+ -I, --[no-]insecure do not verify SSL certificate of API endpoint
593
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
594
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
595
+ -t, --token [ACCESS_TOKEN] access token to use
596
+ --debug show API requests
597
+ -X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
598
+ -r, --repo SLUG repository to use (will try to detect from current git clone)
599
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
600
+ -d, --delete delete listed caches
601
+ -b, --branch BRANCH only list/delete caches on given branch
602
+ -m, --match STRING only list/delete caches where slug matches given string
603
+ -f, --force do not ask user to confirm deleting the caches
604
+
605
+ Lists or deletes [directory caches](http://about.travis-ci.org/docs/user/caching/) for a repository:
606
+
607
+ ``` console
608
+ $ travis cache
609
+ On branch master:
610
+ cache--rvm-2.0.0--gemfile-Gemfile last modified: 2013-11-04 13:45:44 size: 62.21 MiB
611
+ cache--rvm-ruby-head--gemfile-Gemfile last modified: 2013-11-04 13:46:55 size: 62.65 MiB
612
+
613
+ On branch example:
614
+ cache--rvm-2.0.0--gemfile-Gemfile last modified: 2013-11-04 13:45:44 size: 62.21 MiB
615
+
616
+ Overall size of above caches: 187.07 MiB
617
+ ```
618
+
619
+ You can filter by branch:
620
+
621
+ ``` console
622
+ $ travis cache --branch master
623
+ On branch master:
624
+ cache--rvm-2.0.0--gemfile-Gemfile last modified: 2013-11-04 13:45:44 size: 62.21 MiB
625
+ cache--rvm-ruby-head--gemfile-Gemfile last modified: 2013-11-04 13:46:55 size: 62.65 MiB
626
+
627
+ Overall size of above caches: 124.86 MiB
628
+ ```
629
+
630
+ And by matching against the slug:
631
+
632
+ ``` console
633
+ $ travis cache --match 2.0.0
634
+ On branch master:
635
+ cache--rvm-2.0.0--gemfile-Gemfile last modified: 2013-11-04 13:45:44 size: 62.21 MiB
636
+
637
+ Overall size of above caches: 62.21 MiB
638
+ ```
639
+
640
+ You can also use this command to delete caches:
641
+
642
+ ``` console
643
+ $ travis cache -b example -m 2.0.0 --delete
644
+ DANGER ZONE: Do you really want to delete all caches on branch example that match 2.0.0? |no| yes
645
+ Deleted the following caches:
646
+
647
+ On branch example:
648
+ cache--rvm-2.0.0--gemfile-Gemfile last modified: 2013-11-04 13:45:44 size: 62.21 MiB
649
+
650
+ Overall size of above caches: 62.21 MiB
651
+ ```
652
+
653
+ #### `cancel`
654
+
655
+ This command will cancel the latest build:
656
+
657
+ ``` console
658
+ $ travis cancel
659
+ build #85 has been canceled
660
+ ```
661
+
662
+ You can also cancel any build by giving a build number:
663
+
664
+ ``` console
665
+ $ travis cancel 57
666
+ build #57 has been canceled
667
+ ```
668
+
669
+ Or a single job:
670
+
671
+ ``` console
672
+ $ travis cancel 57.1
673
+ job #57.1 has been canceled
674
+ ```
675
+
676
+ #### `disable`
677
+
678
+ If you want to turn of a repository temporarily or indefinitely, you can do so with the `disable` command:
679
+
680
+ ``` console
681
+ $ travis disable
682
+ travis-ci/travis.rb: disabled :(
683
+ ```
684
+
685
+ #### `enable`
686
+
687
+ With the `enable` command, you can easily activate a project on Travis CI:
688
+
689
+ ``` console
690
+ $ travis enable
691
+ travis-ci/travis.rb: enabled :)
692
+ ```
693
+
694
+ It even works when enabling a repo Travis didn't know existed by triggering a sync:
695
+
696
+ ``` console
697
+ $ travis enable -r rkh/test
698
+ repository not known to Travis CI (or no access?)
699
+ triggering sync: ............. done
700
+ rkh/test: enabled
701
+ ```
702
+
703
+ If you don't want the sync to be triggered, use `--skip-sync`.
704
+
705
+ #### `encrypt`
706
+
707
+ Usage: travis encrypt [args..] [options]
708
+ -h, --help Display help
709
+ -i, --[no-]interactive be interactive and colorful
710
+ -E, --[no-]explode don't rescue exceptions
711
+ --skip-version-check don't check if travis client is up to date
712
+ -e, --api-endpoint URL Travis API server to talk to
713
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
714
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
715
+ -t, --token [ACCESS_TOKEN] access token to use
716
+ --debug show API requests
717
+ --adapter ADAPTER Faraday adapter to use for HTTP requests
718
+ -r, --repo SLUG repository to use (will try to detect from current git clone)
719
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
720
+ -a, --add [KEY] adds it to .travis.yml under KEY (default: env.global)
721
+ -s, --[no-]split treat each line as a separate input
722
+ -p, --append don't override existing values, instead treat as list
723
+ -x, --override override existing value
724
+
725
+ This command is useful to encrypt [environment variables](http://about.travis-ci.org/docs/user/encryption-keys/) or deploy keys for private dependencies.
726
+
727
+ ``` console
728
+ $ travis encrypt FOO=bar
729
+ Please add the following to your .travis.yml file:
730
+
731
+ secure: "gSly+Kvzd5uSul15CVaEV91ALwsGSU7yJLHSK0vk+oqjmLm0jp05iiKfs08j\n/Wo0DG8l4O9WT0mCEnMoMBwX4GiK4mUmGdKt0R2/2IAea+M44kBoKsiRM7R3\n+62xEl0q9Wzt8Aw3GCDY4XnoCyirO49DpCH6a9JEAfILY/n6qF8="
732
+
733
+ Pro Tip™: You can add it automatically by running with --add.
734
+ ```
735
+
736
+ For deploy keys, it is really handy to pipe them into the command:
737
+
738
+ ``` console
739
+ $ cat id_rsa | travis encrypt
740
+ ```
741
+
742
+ Another use case for piping files into it: If you have a file with sensitive environment variables, like foreman's [.env](http://ddollar.github.com/foreman/#ENVIRONMENT) file, you can add tell the client to encrypt every line separately via `--split`:
743
+
744
+ ``` console
745
+ $ cat .env | travis encrypt --split
746
+ Please add the following to your .travis.yml file:
747
+
748
+ secure: "KmMdcwTWGubXVRu93/lY1NtyHxrjHK4TzCfemgwjsYzPcZuPmEA+pz+umQBN\n1ZhzUHZwDNsDd2VnBgYq27ZdcS2cRvtyI/IFuM/xJoRi0jpdTn/KsXR47zeE\nr2bFxRqrdY0fERVHSMkBiBrN/KV5T70js4Y6FydsWaQgXCg+WEU="
749
+ secure: "jAglFtDjncy4E3upL/RF0ZOcmJ2UMrqHFCLQwU8PBdurhTMBeTw+IO6cXx5z\nU5zqvPYo/ghZ8mMuUhvHiGDM6m6OlMP7+l10VTxH1CoVew2NcQvRdfK3P+4S\nZJ43Hyh/ZLCjft+JK0tBwoa3VbH2+ZTzkRZQjdg54bE16C7Mf1A="
750
+
751
+ Pro Tip: You can add it automatically by running with --add.
752
+ ```
753
+
754
+ As suggested, the client can also add them to your `.travis.yml` for you:
755
+
756
+ ``` console
757
+ $ travis encrypt FOO=bar --add
758
+ ```
759
+
760
+ This will by default add it as global variables for every job. You can also add it as matrix entries by providing a key:
761
+
762
+ ``` console
763
+ $ travis encrypt FOO=bar --add env.matrix
764
+ ```
765
+
766
+ There are two ways the client can treat existing values:
767
+
768
+ * 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 with `env.` and can be enforced with `--append`.
769
+ * Replace existing value. This is the default behavior for keys that do not start with `env.` and can be enforced with `--override`.
770
+
771
+ #### `encrypt-file`
772
+
773
+ Encrypts a file and adds decryption steps to .travis.yml.
774
+ Usage: travis encrypt-file INPUT_PATH [OUTPUT_PATH] [OPTIONS]
775
+ -h, --help Display help
776
+ -i, --[no-]interactive be interactive and colorful
777
+ -E, --[no-]explode don't rescue exceptions
778
+ --skip-version-check don't check if travis client is up to date
779
+ --skip-completion-check don't check if auto-completion is set up
780
+ -e, --api-endpoint URL Travis API server to talk to
781
+ -I, --[no-]insecure do not verify SSL certificate of API endpoint
782
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
783
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
784
+ -t, --token [ACCESS_TOKEN] access token to use
785
+ --debug show API requests
786
+ -X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
787
+ -r, --repo SLUG repository to use (will try to detect from current git clone)
788
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
789
+ -K, --key KEY encryption key to be used (randomly generated otherwise)
790
+ --iv IV encryption IV to be used (randomly generated otherwise)
791
+ -d, --decrypt decrypt the file instead of encrypting it, requires key and iv
792
+ -f, --force override output file if it exists
793
+ -p, --print-key print (possibly generated) key and iv
794
+ -w, --decrypt-to PATH where to write the decrypted file to on the Travis CI VM
795
+ -a, --add [STAGE] automatically add command to .travis.yml (default stage is before_install)
796
+
797
+ This command will encrypt a file for you using a symmetric encryption (AES-256), and it will store the secret in a [secure variable](#env). It will output the command you can use in your build script to decrypt the file.
798
+
799
+ ``` console
800
+ $ travis encrypt-file bacon.txt
801
+ encrypting bacon.txt for rkh/travis-encrypt-file-example
802
+ storing result as bacon.txt.enc
803
+ storing secure env variables for decryption
804
+
805
+ Please add the following to your build script (before_install stage in your .travis.yml, for instance):
806
+
807
+ openssl aes-256-cbc -K $encrypted_0a6446eb3ae3_key -iv $encrypted_0a6446eb3ae3_key -in bacon.txt.enc -out bacon.txt -d
808
+
809
+ Pro Tip: You can add it automatically by running with --add.
810
+
811
+ Make sure to add bacon.txt.enc to the git repository.
812
+ Make sure not to add bacon.txt to the git repository.
813
+ Commit all changes to your .travis.yml.
814
+ ```
815
+
816
+ You can also use `--add` to have it automatically add the decrypt command to your `.travis.yml`
817
+
818
+ ``` console
819
+ $ travis encrypt-file bacon.txt --add
820
+ encrypting bacon.txt for rkh/travis-encrypt-file-example
821
+ storing result as bacon.txt.enc
822
+ storing secure env variables for decryption
823
+
824
+ Make sure to add bacon.txt.enc to the git repository.
825
+ Make sure not to add bacon.txt to the git repository.
826
+ Commit all changes to your .travis.yml.
827
+ ```
828
+
829
+ #### `env`
830
+
831
+ Show or modify build environment variables.
832
+
833
+ Usage: travis env list [options]
834
+ travis env set name value [options]
835
+ travis env unset [names..] [options]
836
+ travis env copy [names..] [options]
837
+ travis env clear [OPTIONS]
838
+
839
+ -h, --help Display help
840
+ -i, --[no-]interactive be interactive and colorful
841
+ -E, --[no-]explode don't rescue exceptions
842
+ --skip-version-check don't check if travis client is up to date
843
+ --skip-completion-check don't check if auto-completion is set up
844
+ -e, --api-endpoint URL Travis API server to talk to
845
+ -I, --[no-]insecure do not verify SSL certificate of API endpoint
846
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
847
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
848
+ --staging talks to staging system
849
+ -t, --token [ACCESS_TOKEN] access token to use
850
+ --debug show API requests
851
+ -X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
852
+ --adapter ADAPTER Faraday adapter to use for HTTP requests
853
+ --as USER authenticate as given user
854
+ -r, --repo SLUG repository to use (will try to detect from current git clone)
855
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
856
+ -P, --[no-]public make new values public
857
+ -p, --[no-]private make new values private
858
+ -u, --[no-]unescape do not escape values
859
+ -f, --force do not ask for confirmation when clearing out all variables
860
+
861
+ You can set, list and unset environment variables, or copy them from the current environment:
862
+
863
+ ``` console
864
+ $ travis env set foo bar --public
865
+ [+] setting environment variable $foo
866
+ $ travis env list
867
+ # environment variables for travis-ci/travis.rb
868
+ foo=bar
869
+
870
+ $ export foo=foobar
871
+ $ travis env copy foo bar
872
+ [+] setting environment variable $foo
873
+ [+] setting environment variable $bar
874
+ $ travis env list
875
+ # environment variables for travis-ci/travis.rb
876
+ foo=foobar
877
+ bar=[secure]
878
+ $ travis env unset foo bar
879
+ [x] removing environment variable $foo
880
+ [x] removing environment variable $bar
881
+ ```
882
+
883
+ #### `history`
884
+
885
+ Displays a projects build history.
886
+ Usage: travis history [options]
887
+ -h, --help Display help
888
+ -i, --[no-]interactive be interactive and colorful
889
+ -E, --[no-]explode don't rescue exceptions
890
+ --skip-version-check don't check if travis client is up to date
891
+ --skip-completion-check don't check if auto-completion is set up
892
+ -e, --api-endpoint URL Travis API server to talk to
893
+ -I, --[no-]insecure do not verify SSL certificate of API endpoint
894
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
895
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
896
+ -t, --token [ACCESS_TOKEN] access token to use
897
+ --debug show API requests
898
+ -X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
899
+ -r, --repo SLUG repository to use (will try to detect from current git clone)
900
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
901
+ -a, --after BUILD Only show history after a given build number
902
+ -p, --pull-request NUMBER Only show history for the given Pull Request
903
+ -b, --branch BRANCH Only show history for the given branch
904
+ -l, --limit LIMIT Maximum number of history items
905
+ -d, --date Include date in output
906
+ --[no-]all Display all history items
907
+
908
+ You can check out what the recent builds look like:
909
+
910
+ ``` console
911
+ $ travis history
912
+ #77 passed: master fix name clash
913
+ #76 failed: master Merge pull request #11 from travis-ci/rkh-show-logs-history
914
+ #75 passed: rkh-debug what?
915
+ #74 passed: rkh-debug all tests pass locally and on the travis vm I spin up :(
916
+ #73 failed: Pull Request #11 regenerate gemspec
917
+ #72 passed: rkh-show-logs-history regenerate gemspec
918
+ #71 failed: Pull Request #11 spec fix for (older) rubinius
919
+ #70 passed: rkh-show-logs-history spec fix for (older) rubinius
920
+ #69 failed: Pull Request #11 strange fix for rubinius
921
+ #68 failed: rkh-show-logs-history strange fix for rubinius
922
+ ```
923
+
924
+ By default, it will display the last 10 builds. You can limit (or extend) the number of builds with `--limit`:
925
+
926
+ ``` console
927
+ $ travis history --limit 2
928
+ #77 passed: master fix name clash
929
+ #76 failed: master Merge pull request #11 from travis-ci/rkh-show-logs-history
930
+ ```
931
+
932
+ 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):
933
+
934
+ ``` console
935
+ $ travis history --limit 2 --after 76
936
+ #75 passed: rkh-debug what?
937
+ #74 passed: rkh-debug all tests pass locally and on the travis vm I spin up :(
938
+ ```
939
+
940
+ You can also limit the history to builds for a certain branch:
941
+
942
+ ``` console
943
+ $ travis history --limit 3 --branch master
944
+ #77 passed: master fix name clash
945
+ #76 failed: master Merge pull request #11 from travis-ci/rkh-show-logs-history
946
+ #57 passed: master Merge pull request #5 from travis-ci/hh-multiline-encrypt
947
+ ```
948
+
949
+ Or a certain Pull Request:
950
+
951
+ ``` console
952
+ $ travis history --limit 3 --pull-request 5
953
+ #56 passed: Pull Request #5 Merge branch 'master' into hh-multiline-encrypt
954
+ #49 passed: Pull Request #5 improve output
955
+ #48 passed: Pull Request #5 let it generate accessor for line splitting automatically
956
+ ```
957
+
958
+ #### `init`
959
+
960
+ Usage: travis init [language] [file] [options]
961
+ -h, --help Display help
962
+ -i, --[no-]interactive be interactive and colorful
963
+ -E, --[no-]explode don't rescue exceptions
964
+ --skip-version-check don't check if travis client is up to date
965
+ -e, --api-endpoint URL Travis API server to talk to
966
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
967
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
968
+ -t, --token [ACCESS_TOKEN] access token to use
969
+ --debug show API requests
970
+ --adapter ADAPTER Faraday adapter to use for HTTP requests
971
+ -r, --repo SLUG repository to use (will try to detect from current git clone)
972
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
973
+ -s, --skip-sync don't trigger a sync if the repo is unknown
974
+ -f, --force override .travis.yml if it already exists
975
+ -k, --skip-enable do not enable project, only add .travis.yml
976
+ -p, --print-conf print generated config instead of writing to file
977
+ --script VALUE sets script option in .travis.yml (can be used more than once)
978
+ --before-script VALUE sets before_script option in .travis.yml (can be used more than once)
979
+ --after-script VALUE sets after_script option in .travis.yml (can be used more than once)
980
+ --after-success VALUE sets after_success option in .travis.yml (can be used more than once)
981
+ --install VALUE sets install option in .travis.yml (can be used more than once)
982
+ --before-install VALUE sets before_install option in .travis.yml (can be used more than once)
983
+ --compiler VALUE sets compiler option in .travis.yml (can be used more than once)
984
+ --otp-release VALUE sets otp_release option in .travis.yml (can be used more than once)
985
+ --go VALUE sets go option in .travis.yml (can be used more than once)
986
+ --jdk VALUE sets jdk option in .travis.yml (can be used more than once)
987
+ --node-js VALUE sets node_js option in .travis.yml (can be used more than once)
988
+ --perl VALUE sets perl option in .travis.yml (can be used more than once)
989
+ --php VALUE sets php option in .travis.yml (can be used more than once)
990
+ --python VALUE sets python option in .travis.yml (can be used more than once)
991
+ --rvm VALUE sets rvm option in .travis.yml (can be used more than once)
992
+ --scala VALUE sets scala option in .travis.yml (can be used more than once)
993
+ --env VALUE sets env option in .travis.yml (can be used more than once)
994
+ --gemfile VALUE sets gemfile option in .travis.yml (can be used more than once)
995
+
996
+ When setting up a new project, you can run `travis init` to generate a `.travis.yml` and [enable](#enable) the project:
997
+
998
+ ``` console
999
+ $ travis init java
1000
+ .travis.yml file created!
1001
+ travis-ci/java-example: enabled :)
1002
+ ```
1003
+
1004
+ You can also set certain values via command line flags (see list above):
1005
+
1006
+ ``` console
1007
+ $ travis init c --compiler clang
1008
+ .travis.yml file created!
1009
+ travis-ci/c-example: enabled :)
1010
+ ```
1011
+
1012
+ #### `logs`
1013
+
1014
+ Given a job number, logs simply prints out that job's logs. By default it will display the first job of the latest build.
1015
+
1016
+ ``` console
1017
+ $ travis logs
1018
+ displaying logs for travis-ci/travis.rb#317.1
1019
+ [... more logs ...]
1020
+ Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
1021
+ $ bundle exec rake
1022
+ /home/travis/.rvm/rubies/ruby-1.8.7-p371/bin/ruby -S rspec spec -c
1023
+ ..............................................................................................................................................................................................................................................................................
1024
+
1025
+ Finished in 4.46 seconds
1026
+ 270 examples, 0 failures
1027
+
1028
+ Done. Build script exited with: 0
1029
+ ```
1030
+
1031
+ The info line about the job being displayed is written to stderr, the logs itself are written to stdout.
1032
+
1033
+ It takes an optional argument that can be a job number:
1034
+
1035
+ ``` console
1036
+ $ travis logs 100.3
1037
+ displaying logs for travis-ci/travis.rb#100.3
1038
+ ```
1039
+
1040
+ A build number (in which case it will pick the build's first job):
1041
+
1042
+ ``` console
1043
+ $ travis logs 100
1044
+ displaying logs for travis-ci/travis.rb#100.1
1045
+ ```
1046
+
1047
+ Just the job suffix, which will pick the corresponding job from the latest build:
1048
+
1049
+ ``` console
1050
+ $ travis logs .2
1051
+ displaying logs for travis-ci/travis.rb#317.2
1052
+ ```
1053
+
1054
+ A branch name:
1055
+
1056
+ ``` console
1057
+ $ travis logs ghe
1058
+ displaying logs for travis-ci/travis.rb#270.1
1059
+ ```
1060
+
1061
+ You can delete the logs with the `--delete` flag, which optionally takes a reason as argument:
1062
+
1063
+ ``` console
1064
+ $ travis logs --delete
1065
+ DANGER ZONE: Do you really want to delete the build log for travis-ci/travis.rb#559.1? |no| yes
1066
+ deleting log for travis-ci/travis.rb#559.1
1067
+ $ travis logs 1.7 --delete "contained confidential data" --force
1068
+ deleting log for travis-ci/travis.rb#1.7
1069
+ ```
1070
+
1071
+ #### `open`
1072
+
1073
+ 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:
1074
+
1075
+ ``` console
1076
+ $ travis open
1077
+ ```
1078
+
1079
+ If you just want the URL printed out instead of opened in a browser, pass `--print`.
1080
+
1081
+ If instead you want to open the repository, compare or pull request view on GitHub, use `--github`.
1082
+
1083
+ ``` console
1084
+ $ travis open 56 --print --github
1085
+ web view: https://github.com/travis-ci/travis.rb/pull/5
1086
+ ```
1087
+
1088
+ #### `pubkey`
1089
+
1090
+ Outputs the public key for a repository.
1091
+
1092
+ ``` console
1093
+ $ travis pubkey
1094
+ Public key for travis-ci/travis.rb:
1095
+
1096
+ ssh-rsa ...
1097
+ $ travis pubkey -r rails/rails > rails.key
1098
+ ```
1099
+
1100
+ The `--pem` flag will print out the key PEM encoded:
1101
+
1102
+ ``` console
1103
+ $ travis pubkey --pem
1104
+ Public key for travis-ci/travis.rb:
1105
+
1106
+ -----BEGIN PUBLIC KEY-----
1107
+ ...
1108
+ -----END PUBLIC KEY-----
1109
+ ```
1110
+
1111
+ Whereas the `--fingerprint` flag will print out the key's fingerprint:
1112
+
1113
+ ``` console
1114
+ $ travis pubkey --pem
1115
+ Public key for travis-ci/travis.rb:
1116
+
1117
+ 9f:57:01:4b:af:42:67:1e:b4:3c:0f:b6:cd:cc:c0:04
1118
+ ```
1119
+
1120
+ #### `requests`
1121
+
1122
+ With the `requests` 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.
1123
+
1124
+ ``` console
1125
+ $ travis requests -r sinatra/sinatra
1126
+ push to master accepted (triggered new build)
1127
+ abc51e2 - Merge pull request #847 from gogotanaka/add_readme_ja
1128
+ received at: 2014-02-16 09:26:36
1129
+
1130
+ PR #843 rejected (skipped through commit message)
1131
+ 752201c - Update Spanish README with tense, verb, and word corrections. [ci skip]
1132
+ received at: 2014-02-16 05:07:16
1133
+ ```
1134
+
1135
+ You can use `-l`/`--limit` to limit the number of requests displayed.
1136
+
1137
+ #### `restart`
1138
+
1139
+ This command will restart the latest build:
1140
+
1141
+ ``` console
1142
+ $ travis restart
1143
+ build #85 has been restarted
1144
+ ```
1145
+
1146
+ You can also restart any build by giving a build number:
1147
+
1148
+ ``` console
1149
+ $ travis restart 57
1150
+ build #57 has been restarted
1151
+ ```
1152
+
1153
+ Or a single job:
1154
+
1155
+ ``` console
1156
+ $ travis restart 57.1
1157
+ job #57.1 has been restarted
1158
+ ```
1159
+
1160
+ ##### `settings`
1161
+
1162
+ Certain repository settings can be read via the CLI:
1163
+
1164
+ ``` console
1165
+ $ travis settings
1166
+ Settings for travis-ci/travis.rb:
1167
+ [-] builds_only_with_travis_yml Only run builds with a .travis.yml
1168
+ [+] build_pushes Build pushes
1169
+ [+] build_pull_requests Build pull requests
1170
+ [-] maximum_number_of_builds Maximum number of concurrent builds
1171
+ ```
1172
+
1173
+ You can also filter the settings by passing them in as arguments:
1174
+
1175
+ ``` console
1176
+ $ travis settings build_pushes build_pull_requests
1177
+ Settings for travis-ci/travis.rb:
1178
+ [+] build_pushes Build pushes
1179
+ [+] build_pull_requests Build pull requests
1180
+ ```
1181
+
1182
+ It is also possible to change these settings via `--enable`, `--disable` and `--set`:
1183
+
1184
+ ``` console
1185
+ $ travis settings build_pushes --disable
1186
+ Settings for travis-ci/travis.rb:
1187
+ [-] build_pushes Build pushes
1188
+ $ travis settings maximum_number_of_builds --set 1
1189
+ Settings for travis-ci/travis.rb:
1190
+ 1 maximum_number_of_builds Maximum number of concurrent builds
1191
+ ```
1192
+
1193
+ Or, alternatively, you can use `-c` to configure the settings interactively:
1194
+
1195
+ ``` console
1196
+ $ travis settings -c
1197
+ Settings for travis-ci/travis.rb:
1198
+ Only run builds with a .travis.yml? |yes| no
1199
+ Build pushes? |no| yes
1200
+ Build pull requests? |yes|
1201
+ Maximum number of concurrent builds: |1| 5
1202
+ ```
1203
+
1204
+ #### `setup`
1205
+
1206
+ Helps you configure Travis addons.
1207
+
1208
+ Usage: travis setup service [options]
1209
+ -h, --help Display help
1210
+ -i, --[no-]interactive be interactive and colorful
1211
+ -E, --[no-]explode don't rescue exceptions
1212
+ --skip-version-check don't check if travis client is up to date
1213
+ -e, --api-endpoint URL Travis API server to talk to
1214
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
1215
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
1216
+ -t, --token [ACCESS_TOKEN] access token to use
1217
+ --debug show API requests
1218
+ --adapter ADAPTER Faraday adapter to use for HTTP requests
1219
+ -r, --repo SLUG repository to use (will try to detect from current git clone)
1220
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
1221
+ -f, --force override config section if it already exists
1222
+
1223
+ 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` and `sauce_connect`.
1224
+
1225
+ Example:
1226
+
1227
+ ``` console
1228
+ $ travis setup heroku
1229
+ Deploy only from travis-ci/travis-chat? |yes|
1230
+ Encrypt API key? |yes|
1231
+ ```
1232
+
1233
+ #### `show`
1234
+
1235
+ Displays general infos about the latest build:
1236
+
1237
+ ``` console
1238
+ $ travis show
1239
+ Build #77: fix name clash
1240
+ State: passed
1241
+ Type: push
1242
+ Compare URL: https://github.com/travis-ci/travis.rb/compare/7cc9b739b0b6...39b66ee24abe
1243
+ Duration: 5 min 51 sec
1244
+ Started: 2013-01-19 19:00:49
1245
+ Finished: 2013-01-19 19:02:17
1246
+
1247
+ #77.1 passed: 45 sec rvm: 1.8.7
1248
+ #77.2 passed: 50 sec rvm: 1.9.2
1249
+ #77.3 passed: 45 sec rvm: 1.9.3
1250
+ #77.4 passed: 46 sec rvm: 2.0.0
1251
+ #77.5 failed: 1 min 18 sec rvm: jruby (failure allowed)
1252
+ #77.6 passed: 1 min 27 sec rvm: rbx
1253
+ ```
1254
+
1255
+ Any other build:
1256
+
1257
+ ``` console
1258
+ $ travis show 1
1259
+ Build #1: add .travis.yml
1260
+ State: failed
1261
+ Type: push
1262
+ Compare URL: https://github.com/travis-ci/travis.rb/compare/ad817bc37c76...b8c5d3b463e2
1263
+ Duration: 3 min 16 sec
1264
+ Started: 2013-01-13 23:15:22
1265
+ Finished: 2013-01-13 23:21:38
1266
+
1267
+ #1.1 failed: 21 sec rvm: 1.8.7
1268
+ #1.2 failed: 34 sec rvm: 1.9.2
1269
+ #1.3 failed: 24 sec rvm: 1.9.3
1270
+ #1.4 failed: 52 sec rvm: 2.0.0
1271
+ #1.5 failed: 38 sec rvm: jruby
1272
+ #1.6 failed: 27 sec rvm: rbx
1273
+ ```
1274
+
1275
+ The last build for a given branch:
1276
+
1277
+ ``` console
1278
+ $ travis show rkh-debug
1279
+ Build #75: what?
1280
+ State: passed
1281
+ Type: push
1282
+ Branch: rkh-debug
1283
+ Compare URL: https://github.com/travis-ci/travis.rb/compare/8d4aa5254359...7ef33d5e5993
1284
+ Duration: 6 min 16 sec
1285
+ Started: 2013-01-19 18:51:17
1286
+ Finished: 2013-01-19 18:52:43
1287
+
1288
+ #75.1 passed: 1 min 10 sec rvm: 1.8.7
1289
+ #75.2 passed: 51 sec rvm: 1.9.2
1290
+ #75.3 passed: 36 sec rvm: 1.9.3
1291
+ #75.4 passed: 48 sec rvm: 2.0.0
1292
+ #75.5 failed: 1 min 26 sec rvm: jruby (failure allowed)
1293
+ #75.6 passed: 1 min 25 sec rvm: rbx
1294
+ ```
1295
+
1296
+ Or a job:
1297
+
1298
+ ``` console
1299
+ $ travis show 77.3
1300
+ Job #77.3: fix name clash
1301
+ State: passed
1302
+ Type: push
1303
+ Compare URL: https://github.com/travis-ci/travis.rb/compare/7cc9b739b0b6...39b66ee24abe
1304
+ Duration: 45 sec
1305
+ Started: 2013-01-19 19:00:49
1306
+ Finished: 2013-01-19 19:01:34
1307
+ Allow Failure: false
1308
+ Config: rvm: 1.9.3
1309
+ ```
1310
+
1311
+ #### `sshkey`
1312
+
1313
+ Checks, updates or deletes an SSH key.
1314
+ Usage: travis sshkey [OPTIONS]
1315
+ -h, --help Display help
1316
+ -i, --[no-]interactive be interactive and colorful
1317
+ -E, --[no-]explode don't rescue exceptions
1318
+ -e, --api-endpoint URL Travis API server to talk to
1319
+ -I, --[no-]insecure do not verify SSL certificate of API endpoint
1320
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
1321
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
1322
+ -t, --token [ACCESS_TOKEN] access token to use
1323
+ --debug show API requests
1324
+ -X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
1325
+ -r, --repo SLUG repository to use (will try to detect from current git clone)
1326
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
1327
+ -D, --delete remove SSH key
1328
+ -d, --description DESCRIPTION set description
1329
+ -u, --upload FILE upload key from given file
1330
+ -s, --stdin upload key read from stdin
1331
+ -c, --check set exit code depending on key existing
1332
+ -g, --generate generate SSH key and set up for given GitHub user
1333
+ -p, --passphrase PASSPHRASE pass phrase to decrypt with when using --upload
1334
+
1335
+ *This feature is for [Pro and Enterprise](#pro-and-enterprise) only.*
1336
+
1337
+ With the `sshkey` command you can check if there is a custom SSH key set up. Custom SSH keys are used for cloning the repository.
1338
+
1339
+ ``` console
1340
+ $ travis sshkey
1341
+ No custom SSH key installed.
1342
+ ```
1343
+
1344
+ You can also use it to upload an SSH key:
1345
+
1346
+ ``` console
1347
+ $ travis sshkey --upload ~/.ssh/id_rsa
1348
+ Key description: Test Key
1349
+ updating ssh key for travis-pro/test-project with key from /Users/konstantin/.ssh/id_rsa
1350
+ Current SSH key: Test Key
1351
+ ```
1352
+
1353
+ And to remove it again:
1354
+
1355
+ ``` console
1356
+ $ travis sshkey --delete
1357
+ DANGER ZONE: Remove SSH key for travis-pro/test-project? |no| yes
1358
+ removing ssh key for travis-pro/test-project
1359
+ No custom SSH key installed.
1360
+ ```
1361
+
1362
+ 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:
1363
+
1364
+ ``` console
1365
+ $ travis sshkey --generate
1366
+ We need the GitHub login for the account you want to add the key to.
1367
+ This information will not be sent to Travis CI, only to api.github.com.
1368
+ The password will not be displayed.
1369
+
1370
+ Username: travisbot
1371
+ Password for travisbot: **************
1372
+
1373
+ Generating RSA key.
1374
+ Uploading public key to GitHub.
1375
+ Uploading private key to Travis CI.
1376
+ ```
1377
+
1378
+ See the [private dependencies example](examples/cli/private_dependencies.md) for an in-detail description.
1379
+
1380
+ #### `status`
1381
+
1382
+ Usage: travis status [options]
1383
+ -h, --help Display help
1384
+ -i, --[no-]interactive be interactive and colorful
1385
+ -E, --[no-]explode don't rescue exceptions
1386
+ -e, --api-endpoint URL Travis API server to talk to
1387
+ --pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
1388
+ --org short-cut for --api-endpoint 'https://api.travis-ci.org/'
1389
+ -t, --token [ACCESS_TOKEN] access token to use
1390
+ --debug show API requests
1391
+ -r, --repo SLUG repository to use (will try to detect from current git clone)
1392
+ -R, --store-repo SLUG like --repo, but remembers value for current directory
1393
+ -x, --[no-]exit-code sets the exit code to 1 if the build failed
1394
+ -q, --[no-]quiet does not print anything
1395
+ -p, --[no-]fail-pending sets the status code to 1 if the build is pending
1396
+
1397
+ 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.
1398
+
1399
+ ``` console
1400
+ $ travis status -qpx && cap deploy
1401
+ ```
1402
+
1403
+ ### Pro and Enterprise
1404
+
1405
+ By default, [General API Commands](#general-api-commands) will talk to [api.travis-ci.org](https://api.travis-ci.org). You can change this by supplying `--pro` for [api.travis-ci.com](https://api.travis-ci.com) or `--api-endpoint` with your own endpoint. Note that all [Repository Commands](#repository-commands) will try to figure out the API endpoint to talk to automatically depending on the project's visibility on GitHub.
1406
+
1407
+ ``` console
1408
+ $ travis login --pro
1409
+ ...
1410
+ $ travis monitor --pro -m
1411
+ ...
1412
+ ```
1413
+
1414
+ The custom `--api-endpoint` option is handy for local development:
1415
+
1416
+ ``` console
1417
+ $ travis whatsup --api-endpoint http://localhost:3000
1418
+ ...
1419
+ ```
1420
+
1421
+ 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.
1422
+
1423
+ ``` console
1424
+ $ travis login -X
1425
+ Enterprise domain: travisci.example.com
1426
+ ...
1427
+ $ travis whatsup -X
1428
+ ...
1429
+ ```
1430
+
1431
+ Note that currently [Repository Commands](#repository-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.
1432
+
1433
+ ### Environment Variables
1434
+
1435
+ You can set the following environment variables to influence the travis behavior:
1436
+
1437
+ * `$TRAVIS_TOKEN` - access token to use when the `--token` flag is not user
1438
+ * `$TRAVIS_ENDPOINT` - API endpoint to use when the `--api-endpoint`, `--org` or `--pro` flag is not used
1439
+ * `$TRAVIS_CONFIG_PATH` - directory to store configuration in (defaults to ~/.travis)
1440
+
1441
+ ### Desktop Notifications
1442
+
1443
+ Some commands support sending desktop notifications. The following notification systems are currently supported:
1444
+
1445
+ * **Notification Center** - requires Mac OSX 10.8 or later and [Notification Center](http://support.apple.com/kb/ht5362) must be running under the system executing the `travis` command.
1446
+ * **Growl** - [growlnotify](http://growl.info/downloads#generaldownloads) has to be installed and [Growl](https://itunes.apple.com/us/app/growl/id467939042?mt=12&ign-mpt=uo%3D4) needs to be running. Does currently not support the Windows version of Growl.
1447
+ * **libnotify** - needs [libnotify](http://www.linuxfromscratch.org/blfs/view/svn/x/libnotify.html) installed, including the `notify-send` executable.
1448
+
1449
+ ### Plugins
1450
+
1451
+ The `travis` 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 via [`travis report`](#report).
1452
+
1453
+ It is possible to define new commands directly in the [init.rb](https://github.com/travis-ci/travis-build/blob/master/init.rb) or to set up [lazy-loading](https://github.com/travis-ci/travis-cli-pr/blob/master/init.rb) for these.
1454
+
1455
+ #### Official Plugins
1456
+
1457
+ * [travis-cli-gh](https://github.com/travis-ci/travis-cli-gh#readme): Plugin for interacting with the GitHub API.
1458
+
1459
+ ## Ruby Library
1460
+
1461
+ There are two approaches of using the Ruby library, one straight forward with one global session:
1462
+
1463
+ ``` ruby
1464
+ require 'travis'
1465
+
1466
+ rails = Travis::Repository.find('rails/rails')
1467
+ puts "oh no" unless rails.green?
1468
+ ```
1469
+
1470
+ And one where you have to instantiate your own session:
1471
+
1472
+ ``` ruby
1473
+ require 'travis/client'
1474
+
1475
+ client = Travis::Client.new
1476
+ rails = client.repo('rails/rails')
1477
+ puts "oh no" unless rails.green?
1478
+ ```
1479
+
1480
+ 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 uses `Travis::Client` internally.
1481
+
1482
+ 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.
1483
+
1484
+ 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:
1485
+
1486
+ ``` ruby
1487
+ Travis.clear_cache
1488
+ client.clear_cache
1489
+ ```
1490
+
1491
+ Note that this will still keep the identity map around, it will only drop all attributes. To clear the identity map, you can use the `clear_cache!` method. However, if you do that, you should not keep old instances of any entities (like repositories, etc) around.
1492
+
1493
+ ### Authentication
1494
+
1495
+ Authentication is pretty easy, you just need to set an access token:
1496
+
1497
+ ``` ruby
1498
+ require 'travis'
1499
+
1500
+ Travis.access_token = "..."
1501
+ puts "Hello #{Travis::User.current.name}!"
1502
+ ```
1503
+
1504
+ Or with your own client instance:
1505
+
1506
+ ``` ruby
1507
+ require 'travis/client'
1508
+
1509
+ client = Travis::Client.new(access_token: "...")
1510
+ puts "Hello #{client.user.name}"
1511
+ ```
1512
+
1513
+ See [the token command](#token) for obtaining the access token used by the CLI.
1514
+
1515
+ If you don't have an access token for Travis CI, you can use a GitHub access token to get one:
1516
+
1517
+ ``` ruby
1518
+ require 'travis'
1519
+
1520
+ Travis.github_auth("...")
1521
+ puts "Hello #{Travis::User.current.name}!"
1522
+ ```
1523
+
1524
+ Travis CI will not store that token.
1525
+
1526
+ It also ships with a tool for generating a GitHub token from a user name and password via the GitHub API:
1527
+
1528
+ ``` ruby
1529
+ require 'travis'
1530
+ require 'travis/tools/github'
1531
+
1532
+ # drop_token will make the token a temporary one
1533
+ github = Travis::Tools::Github.new(drop_token: true) do |g|
1534
+ g.ask_login = -> { print("GitHub login: "); gets }
1535
+ g.ask_password = -> { print("Password: "); gets }
1536
+ g.ask_otp = -> { print("Two-factor token: "); gets }
1537
+ end
1538
+
1539
+ github.with_token do |token|
1540
+ Travis.github_auth(token)
1541
+ end
1542
+
1543
+ puts "Hello #{Travis::User.current.name}!"
1544
+ ```
1545
+
1546
+ There is also `travis/auto_login`, which will try to read the CLI configuration or .netrc for a Travis CI or GitHub token to authenticate with automatically:
1547
+
1548
+ ``` ruby
1549
+ require 'travis/auto_login'
1550
+ puts "Hello #{Travis::User.current.name}!"
1551
+ ```
1552
+
1553
+ ### Using Pro
1554
+
1555
+ Using the library with private projects pretty much works the same, except you use `Travis::Pro`.
1556
+
1557
+ Keep in mind that you need to authenticate.
1558
+
1559
+ ``` ruby
1560
+ require 'travis/pro'
1561
+
1562
+ Travis::Pro.access_token = '...'
1563
+ user = Travis::Pro::User.current
1564
+
1565
+ puts "Hello #{user.name}!"
1566
+ ```
1567
+
1568
+ There is also `travis/pro/auto_login`, which will try to read the CLI configuration or .netrc for a Travis CI or GitHub token to authenticate with automatically:
1569
+
1570
+ ``` ruby
1571
+ require 'travis/pro/auto_login'
1572
+ puts "Hello #{Travis::Pro::User.current.name}!"
1573
+ ```
1574
+
1575
+ ### Entities
1576
+
1577
+ 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.
1578
+ They are pretty much normal Ruby objects.
1579
+
1580
+ The Travis session will cache all entities, so don't worry about loading the same one twice.
1581
+ 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:
1582
+
1583
+ ``` ruby
1584
+ rails = Travis::Repository.find('rails/rails')
1585
+ sleep 1.hour
1586
+ rails.reload
1587
+ ```
1588
+
1589
+ The travis gem supports lazy and partial loading, so if you want to make sure you have all the data, just call load.
1590
+
1591
+ ``` ruby
1592
+ rails.load
1593
+ ```
1594
+
1595
+ This is not something you should usually do, as partial loading is actually your friend (keeps requests to a minimum).
1596
+
1597
+
1598
+ #### Stateful Entities
1599
+
1600
+ [Repositories](#repositories), [Builds](#builds) and [Jobs](#jobs) all are basically state machines, which means they implement the following methods:
1601
+
1602
+ ``` ruby
1603
+ require 'travis'
1604
+ build = Travis::Repository.find('rails/rails').last_build
1605
+
1606
+ p build.canceled?
1607
+ p build.created?
1608
+ p build.errored?
1609
+ p build.failed?
1610
+ p build.finished?
1611
+ p build.green?
1612
+ p build.passed?
1613
+ p build.pending?
1614
+ p build.queued?
1615
+ p build.red?
1616
+ p build.running?
1617
+ p build.started?
1618
+ p build.successful?
1619
+ p build.unsuccessful?
1620
+ p build.yellow?
1621
+ p build.color
1622
+ ```
1623
+
1624
+ Builds and jobs also have a `state` method. For repositories, use `last_build.state`.
1625
+
1626
+ #### Repositories
1627
+
1628
+ Repositories are probably one of the first entities you'll load. It's pretty straight forward, too.
1629
+
1630
+ ``` ruby
1631
+ require 'travis'
1632
+
1633
+ Travis::Repository.find('rails/rails') # find by slug
1634
+ Travis::Repository.find(891) # find by id
1635
+ Travis::Repository.find_all(owner_name: 'rails') # all repos in the rails organization
1636
+ Travis::Repository.current # repos that see some action right now
1637
+
1638
+ # all repos with the same owner as the repo with id 891
1639
+ Travis::Repository.find(891).owner.repositories
1640
+ ```
1641
+
1642
+ Once you have a repository, you can for instance encrypt some strings with its private key:
1643
+
1644
+ ``` ruby
1645
+ require 'travis'
1646
+
1647
+ Travis::Repository.find('rails/rails')
1648
+ puts repo.encrypt('FOO=bar')
1649
+ ```
1650
+
1651
+ Repositories are [stateful](#stateful-entities).
1652
+
1653
+ You can enable or disable a repository with the methods that go by the same name.
1654
+
1655
+ ``` ruby
1656
+ rails.disable
1657
+ system "push all the things"
1658
+ rails.enable
1659
+ ```
1660
+
1661
+ If you want to enable a new project, you might have to do a sync first.
1662
+
1663
+ #### Builds
1664
+
1665
+ You could load a build by its id using `Travis::Build.find`. But most of the time you won't have the id handy, so you'd usually start with a repository.
1666
+
1667
+ ``` ruby
1668
+ require 'travis'
1669
+ rails = Travis::Repository.find('rails/rails')
1670
+
1671
+ rails.last_build # the latest build
1672
+ rails.recent_builds # the last 20 or so builds (don't rely on that number)
1673
+ rails.builds(after_number: 42) # the last 20 or so builds *before* 42
1674
+ rails.build(42) # build with the number 42 (not the id!)
1675
+ rails.builds # Enumerator for #each_build
1676
+
1677
+ # this will loop through all builds
1678
+ rails.each_build do |build|
1679
+ puts "#{build.number}: #{build.state}"
1680
+ end
1681
+
1682
+ # this will loop through all builds before build 42
1683
+ rails.each_build(after_number: 42) do |build|
1684
+ puts "#{build.number}: #{build.state}"
1685
+ end
1686
+ ```
1687
+
1688
+ Note that `each_build` (and thus `builds` without and argument) is lazy and uses pagination, so you can safely do things like this:
1689
+
1690
+ ``` ruby
1691
+ build = rails.builds.detect { |b| b.failed? }
1692
+ puts "Last failing Rails build: #{build.number}"
1693
+ ```
1694
+
1695
+ Without having to load more than 6000 builds.
1696
+
1697
+ You can restart a build, if the current user has sufficient permissions on the repository:
1698
+
1699
+ ``` ruby
1700
+ rails.last_build.restart
1701
+ ```
1702
+
1703
+ Same goes for canceling it:
1704
+
1705
+ ``` ruby
1706
+ rails.last_build.cancel
1707
+ ```
1708
+
1709
+ You can also retrieve a Hash mapping branch names to the latest build on that given branch via `branches` or use the `branch` method to get the last build for a specific branch:
1710
+
1711
+ ``` ruby
1712
+ if rails.branch('4-0-stable').green?
1713
+ puts "Time for another 4.0.x release!"
1714
+ end
1715
+
1716
+ count = rails.branches.size
1717
+ puts "#{count} rails branches tested on travis"
1718
+ ```
1719
+
1720
+ #### Jobs
1721
+
1722
+ Jobs behave a lot like [builds](#builds), and similar to them, you probably don't have the id ready. You can get the jobs from a build:
1723
+
1724
+ ``` ruby
1725
+ rails.last_build.jobs.each do |job|
1726
+ puts "#{job.number} took #{job.duration} seconds"
1727
+ end
1728
+ ```
1729
+
1730
+ If you have the job number, you can also reach a job directly from the repository:
1731
+
1732
+ ``` ruby
1733
+ rails.job('5000.1')
1734
+ ```
1735
+
1736
+ Like builds, you can also restart singe jobs:
1737
+
1738
+ ``` ruby
1739
+ rails.job('5000.1').restart
1740
+ ```
1741
+
1742
+ Same goes for canceling it:
1743
+
1744
+ ``` ruby
1745
+ rails.job('5000.1').cancel
1746
+ ```
1747
+
1748
+ #### Artifacts
1749
+
1750
+ The artifacts you usually care for are probably logs. You can reach them directly from a build:
1751
+
1752
+ ``` ruby
1753
+ require 'travis'
1754
+
1755
+ repo = Travis::Repository.find('travis-ci/travis.rb')
1756
+ job = repo.last_build.jobs.first
1757
+ puts job.log.body
1758
+ ```
1759
+
1760
+ If you plan to print out the body, be aware that it might contain malicious escape codes. For this reason, we added `colorized_body`, which removes all the unprintable characters, except for ANSI color codes, and `clean_body` which also removes the color codes.
1761
+
1762
+ ``` ruby
1763
+ puts job.log.colorized_body
1764
+ ````
1765
+
1766
+ You can stream a body for a job that is currently running by passing a block:
1767
+
1768
+ ``` ruby
1769
+ job.log.body { |chunk| print chunk }
1770
+ ```
1771
+
1772
+ #### Users
1773
+
1774
+ The only user you usually get access to is the currently authenticated one.
1775
+
1776
+ ``` ruby
1777
+ require 'travis'
1778
+
1779
+ Travis.access_token = '...'
1780
+ user = Travis::User.current
1781
+
1782
+ puts "Hello, #{user.login}! Or should I call you... #{user.name.upcase}!?"
1783
+ ```
1784
+
1785
+ If some data gets out of sync between GitHub and Travis, you can use the user object to trigger a new sync.
1786
+
1787
+ ``` ruby
1788
+ Travis::User.current.sync
1789
+ ```
1790
+
1791
+ #### Commits
1792
+
1793
+ Commits cannot be loaded directly. They come as a byproduct of [jobs](#jobs) and [builds](#builds).
1794
+
1795
+ ``` ruby
1796
+ require 'travis'
1797
+
1798
+ repo = Travis::Repository.find('travis-ci/travis.rb')
1799
+ commit = repo.last_build.commit
1800
+
1801
+ puts "Last tested commit: #{commit.short_sha} on #{commit.branch} by #{commit.author_name} - #{commit.subject}"
1802
+ ```
1803
+
1804
+ #### Caches
1805
+
1806
+ Caches can be fetched for a repository.
1807
+
1808
+ ``` ruby
1809
+ require 'travis/pro'
1810
+
1811
+ Travis::Pro.access_token = "MY SECRET TOKEN"
1812
+ repo = Travis::Pro::Repository.find("my/rep")
1813
+
1814
+ repo.caches.each do |cache|
1815
+ puts "#{cache.branch}: #{cache.size}"
1816
+ cache.delete
1817
+ end
1818
+ ```
1819
+
1820
+ It is also possible to delete multiple caches with a single API call:
1821
+
1822
+ ``` ruby
1823
+ repo.delete_caches(branch: "master", match: "rbx")
1824
+ ```
1825
+
1826
+ #### Repository Settings
1827
+
1828
+ You can access a repositories settings via `Repository#settings`:
1829
+
1830
+ ``` ruby
1831
+ require 'travis'
1832
+
1833
+ Travis.access_token = "MY SECRET TOKEN"
1834
+ settings = Travis::Repository.find('my/repo').settings
1835
+
1836
+ if settings.build_pushes?
1837
+ settings.build_pushes = false
1838
+ settings.save
1839
+ end
1840
+ ```
1841
+
1842
+ #### Build Environment Variables
1843
+
1844
+ You can access environment variables via `Repository#env_vars`:
1845
+
1846
+ ``` ruby
1847
+ require 'travis'
1848
+
1849
+ Travis.access_token = "MY SECRET TOKEN"
1850
+ env_vars = Travis::Repository.find('my/repo').env_vars
1851
+
1852
+ env_vars['foo'] = 'bar'
1853
+ env_vars.upsert('foo', 'foobar', public: true)
1854
+ env_vars.each { |var| var.delete }
1855
+ ```
1856
+
1857
+ ### Dealing with Sessions
1858
+
1859
+ 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.
1860
+
1861
+ There are two levels of session methods, the higher level methods from the `Travis::Client::Methods` mixin, which are also available from `Travis`, `Travis::Pro` or any custom [Namespace](#using-namespaces).
1862
+
1863
+ ``` ruby
1864
+ require 'travis/client/session'
1865
+ session = Travis::Client::Session.new
1866
+
1867
+ session.access_token = "secret_token" # access token to use
1868
+ session.api_endpoint = "http://localhost:3000/" # api endpoint to talk to
1869
+ session.github_auth("github_token") # log in with a github token
1870
+ session.repos(owner_name: 'travis-ci') # all travis-ci/* projects
1871
+ session.repo('travis-ci/travis.rb') # this project
1872
+ session.repo(409371) # same as the one above
1873
+ session.build(4266036) # build with id 4266036
1874
+ session.job(4266037) # job with id 4266037
1875
+ session.artifact(42) # artifact with id 42
1876
+ session.log(42) # same as above
1877
+ session.user # the current user, if logged in
1878
+ session.restart(session.build(4266036)) # restart some build
1879
+ session.cancel(session.build(4266036)) # cancel some build
1880
+ ```
1881
+
1882
+ You can add these methods to any object responding to `session` via said mixin.
1883
+
1884
+ Below this, there is a second API, close to the HTTP level:
1885
+
1886
+ ``` ruby
1887
+ require 'travis/client/session'
1888
+ session = Travis::Client::Session.new
1889
+
1890
+ session.instrument do |description, block|
1891
+ time = Time.now
1892
+ block.call
1893
+ puts "#{description} took #{Time.now - time} seconds"
1894
+ end
1895
+
1896
+ session.connection = Faraday::Connection.new
1897
+
1898
+ session.get_raw('/repos/rails/rails') # => {"repo" => {"id" => 891, "slug" => "rails/rails", ...}}
1899
+ session.get('/repos/rails/rails') # => {"repo" => #<Travis::Client::Repository: rails/rails>}
1900
+ session.headers['Foo'] = 'Bar' # send a custom HTTP header with every request
1901
+
1902
+ rails = session.find_one(Travis::Client::Repository, 'rails/rails')
1903
+
1904
+ session.find_many(Travis::Client::Repository) # repositories with the latest builds
1905
+ session.find_one_or_many(Travis::Client::User) # the current user (you could also use find_one here)
1906
+
1907
+ session.reload(rails)
1908
+ session.reset(rails) # lazy reload
1909
+
1910
+ session.clear_cache # empty cached attributes
1911
+ session.clear_cache! # empty identity map
1912
+ ```
1913
+
1914
+ ### Listening for Events
1915
+
1916
+ You can use the `listen` method to listen for events on repositories, builds or jobs:
1917
+
1918
+ ``` ruby
1919
+ require 'travis'
1920
+
1921
+ rails = Travis::Repository.find("rails/rails")
1922
+ sinatra = Travis::Repository.find("sinatra/sinatra")
1923
+
1924
+ Travis.listen(rails, sinatra) do |stream|
1925
+ stream.on('build:started', 'build:finished') do |event|
1926
+ # ie "rails/rails just passed"
1927
+ puts "#{event.repository.slug} just #{event.build.state}"
1928
+ end
1929
+ end
1930
+ ```
1931
+
1932
+ Current events are `build:created`, `build:started`, `build:finished`, `job:created`, `job:started`, `job:finished` and `job:log` (the last one only when subscribing to jobs explicitly). Not passing any arguments to `listen` will monitor the global stream.
1933
+
1934
+ ### Using Namespaces
1935
+
1936
+ `Travis` and `Travis::Pro` are just two different namespaces for two different Travis sessions. A namespace is a Module, exposing the higher level [session methods](#dealing-with-sessions). It also has a dummy constant for every [entity](#entities), wrapping `find_one` (aliased to `find`) and `find_many` (aliased to `find_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:
1937
+
1938
+ ``` ruby
1939
+ require 'travis/client'
1940
+ MyTravis = Travis::Client::Namespaces.new("http://localhost:3000")
1941
+
1942
+ MyTravis.access_token = "..."
1943
+ MyTravis::Repository.find("foo/bar")
1944
+ ```
1945
+
1946
+ Since namespaces are Modules, you can also include them.
1947
+
1948
+ ``` ruby
1949
+ require 'travis/client'
1950
+
1951
+ class MyTravis
1952
+ include Travis::Client::Namespaces.new
1953
+ end
1954
+
1955
+ MyTravis::Repository.find('rails/rails')
1956
+ ```
1957
+
1958
+ ## Installation
1959
+
1960
+ Make sure you have at least [Ruby](http://www.ruby-lang.org/en/downloads/) 1.9.3 (2.0.0 recommended) installed.
1961
+
1962
+ You can check your Ruby version by running `ruby -v`:
1963
+
1964
+ $ ruby -v
1965
+ ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]
1966
+
1967
+ Then run:
1968
+
1969
+ $ gem install travis -v 1.8.2 --no-rdoc --no-ri
1970
+
1971
+ Now make sure everything is working:
1972
+
1973
+ $ travis version
1974
+ 1.8.2
1975
+
1976
+ See also [Note on Ubuntu](#ubuntu) below.
1977
+
1978
+ ### Development Version
1979
+
1980
+ You can also install the development version via RubyGems:
1981
+
1982
+ $ gem install travis --pre
1983
+
1984
+ We automatically publish a new development version after every successful build.
1985
+
1986
+ ### Updating your Ruby
1987
+
1988
+ If you have an outdated Ruby version, you should use your package system or a Ruby Installer to install a recent Ruby.
1989
+
1990
+ #### Mac OS X via Homebrew
1991
+
1992
+ Mac OSX prior to 10.9 ships with a very dated Ruby version. You can use [Homebrew](http://mxcl.github.io/homebrew/) to install a recent version:
1993
+
1994
+ $ brew install ruby
1995
+ $ gem update --system
1996
+
1997
+ #### Windows
1998
+
1999
+ On Windows, we recommend using the [RubyInstaller](http://rubyinstaller.org/), which includes the latest version of Ruby.
2000
+
2001
+ #### Other Unix systems
2002
+
2003
+ On other Unix systems, like Linux, use your package system to install Ruby. Please inquire before hand which package you might actually want to install, as for some distributions `ruby` might actually still be 1.8.7 or older.
2004
+
2005
+ Debian:
2006
+
2007
+ $ sudo apt-get install ruby1.9.3 ruby1.9.3-dev ruby-switch
2008
+ $ sudo ruby-switch --set ruby1.9.3
2009
+
2010
+ Ubuntu:
2011
+
2012
+ $ sudo apt-get install python-software-properties
2013
+ $ sudo apt-add-repository ppa:brightbox/ruby-ng
2014
+ $ sudo apt-get update
2015
+ $ sudo apt-get install ruby2.1 ruby-switch
2016
+ $ sudo ruby-switch --set ruby2.1
2017
+
2018
+ Fedora:
2019
+
2020
+ $ sudo yum install ruby ruby-devel
2021
+
2022
+ Arch Linux:
2023
+
2024
+ $ sudo pacman -S ruby
2025
+
2026
+ #### Ruby versioning tools
2027
+
2028
+ Alternatively, you can use a Ruby version management tool such as [rvm](https://rvm.io/rvm/install/), [rbenv](http://rbenv.org/) or [chruby](https://github.com/postmodern/chruby). This is only recommended if you need to run multiple versions of Ruby.
2029
+
2030
+ 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.
2031
+
2032
+ ### Troubleshooting
2033
+
2034
+ #### Ubuntu
2035
+
2036
+ On certain versions of Ubuntu (e.g., 13.10), you need to install the corresponding `-dev` package
2037
+ in order to build the C extension on which `travis` gem depends.
2038
+
2039
+ For the stock Ubuntu 13.10, run:
2040
+
2041
+ $ sudo apt-get install ruby1.9.1-dev
2042
+
2043
+ If you updated to Ruby 2.1 as shown above:
2044
+
2045
+ $ sudo apt-get install ruby2.1-dev
2046
+
2047
+ #### Mac OS X
2048
+
2049
+ If you start with a clean Mac OS X, you will have to install the XCode Command Line Tools, which are necessary for installing native extensions. You can do so via `xcode-select`:
2050
+
2051
+ $ xcode-select --install
2052
+
2053
+ Mac OS X 10.9.2 shipped with a slightly broken Ruby version. If you want to install the gem via the system Ruby and you get an error, you might have to run the following instead:
2054
+
2055
+ $ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install travis
2056
+
2057
+ #### Upgrading from travis-cli
2058
+
2059
+ If you have the old `travis-cli` gem installed, you should `gem uninstall travis-cli`, just to be sure, as it ships with an executable that is also named `travis`.
2060
+
2061
+ ## Version History
2062
+
2063
+ **1.8.0** (July 15, 2015)
2064
+
2065
+ * Fix listener for pusher changes on [travis-ci.org](https://travis-ci.org).
2066
+ * Change `monitor` command to only monitor personal repositories if `common` channel is not available.
2067
+
2068
+ **1.7.7** (May 26, 2015)
2069
+
2070
+ * Fix `travis whatsup` for fresh Travis Enterprise installations.
2071
+
2072
+ **1.7.6** (April 08, 2015)
2073
+
2074
+ * Add support for "received" build state.
2075
+ * Fix issue with archived logs.
2076
+ * On version check, do not kill the process if a newer version has been released.
2077
+
2078
+ **1.7.5** (January 15, 2015)
2079
+
2080
+ * Add support for url.<remote>.insteadOf
2081
+ * Fix packaging error with 1.7.4, in which Code Deploy setup code was not included
2082
+
2083
+ **1.7.4** (November 12, 2014)
2084
+
2085
+ * Add `travis setup codedeploy`
2086
+
2087
+ **1.7.3** (November 10, 2014)
2088
+
2089
+ * Add `travis setup biicode`
2090
+ * Add `travis env clear`
2091
+ * Print error message if `travis login` is run for a GitHub account unknown to the Travis CI setup.
2092
+ * Fix bug in S3 ACL settings.
2093
+ * Make `travis console` work with newer pry versions.
2094
+
2095
+ **1.7.2** (September 17, 2014)
2096
+
2097
+ * Add `travis setup elasticbeanstalk`.
2098
+ * Properly display educational accounts in `travis accounts`.
2099
+ * Upgrade go version default for `travis init`.
2100
+ * Fix SSL verification issue on OS X Yosemite and certain Linux setups.
2101
+ * Be more forgiving with outdated API version (Enterprise).
2102
+ * Better handling of multibyte characters in archived logs.
2103
+ * Use more restricitve permissions for the config file.
2104
+
2105
+ **1.7.1** (August 9, 2014)
2106
+
2107
+ * Better error message when trying to encrypt a string that is too long.
2108
+ * Fix Validation failed error using `travis sshkey --upload`.
2109
+
2110
+ **1.7.0** (August 5, 2014)
2111
+
2112
+ * Add `travis encrypt-file`.
2113
+ * Add `--store-repo`/`-R` to repository commands to permanently store the slug for a repository.
2114
+ * Announce repository slug when first detected, ask for confirmation in interactive mode.
2115
+ * Have `travis repos` only print repository slugs in non-interactive mode.
2116
+ * Add `travis/auto_login` and `travis/pro/auto_login` to the Ruby API for easy authentication.
2117
+ * Add `--fingerprint` to `pubkey` command.
2118
+ * Add `fingerprint` to `Repository#public_key`.
2119
+ * Display better error messages for user errors (user data validation failing, etc).
2120
+ * Have `travis sshkey --upload` check that the content is a private key.
2121
+ * Make `travis sshkey --upload` prompt for and remove the pass phrase if the key is encrypted.
2122
+
2123
+ **1.6.17** (July 25, 2014)
2124
+
2125
+ * Add `travis sshkey` and corresponding Ruby API.
2126
+ * Make desktop notifications work on Mac OS X 10.10.
2127
+
2128
+ **1.6.16** (July 19, 2014)
2129
+
2130
+ * Fix check for updates.
2131
+
2132
+ **1.6.15** (July 18, 2014)
2133
+
2134
+ * Add `travis env [list|add|set|copy]`.
2135
+ * Add `Repository#env_vars`.
2136
+ * Add `travis setup ghc`.
2137
+ * Add `Log#delete_body`, `Job#delete_log` and `Build#delete_logs` to Ruby API.
2138
+ * Add `--delete`, `--force` and `--no-stream` options to `travis logs`.
2139
+ * Add `acl` option to `travis setup s3`.
2140
+ * Add `--set` option to `travis settings`, support non-boolean values.
2141
+ * Expose `maximum_number_of_builds` setting.
2142
+ * Give GitHub OAuth token generated by `travis setup releases` a proper description.
2143
+ * Proper handling for empty or broken config files.
2144
+ * Reset terminal colors after `travis logs`.
2145
+
2146
+ **1.6.14** (June 17, 2014)
2147
+
2148
+ * Add `travis lint` command and Ruby API.
2149
+
2150
+ **1.6.13** (June 15, 2014)
2151
+
2152
+ * Added Deis and Hackage setup support.
2153
+
2154
+ **1.6.12** (June 12, 2014)
2155
+
2156
+ * Added artifacts setup support.
2157
+
2158
+ **1.6.11** (May 12, 2014)
2159
+
2160
+ * Added Cloud 66 and Ninefold setup support.
2161
+ * Require typhoeus 0.6.8 and later.
2162
+
2163
+ **1.6.10** (April 24, 2014)
2164
+
2165
+ * Better CloudFoundry support
2166
+ * Update Faraday to version 0.9.
2167
+
2168
+ **1.6.9** (April 9, 2014)
2169
+
2170
+ * Add `--limit` to `travis requests`.
2171
+ * Add `--committer` option to `travis history`.
2172
+ * Avoid error when running `travis login` with a revoked token.
2173
+ * Add `travis setup releases`.
2174
+ * Desktop notifications via libnotify are now transient (disappear on their own if the user is active).
2175
+ * Update Rubinius version generated by `travis init ruby`.
2176
+ * Improve setup when running `travis` executable that has not been installed via RubyGems.
2177
+
2178
+ **1.6.8** (March 12, 2014)
2179
+
2180
+ * Display annotations in `travis show`.
2181
+ * Add `travis requests` to see build requests Travis CI has received.
2182
+ * Improve annotation support in the Ruby library.
2183
+ * Add `Repository#requests` to Ruby library.
2184
+ * Fix behavior for missing entities.
2185
+
2186
+ **1.6.7** (January 30, 2014)
2187
+
2188
+ * Properly display OS for projects tested on multiple operating systems.
2189
+ * Better error message when using an invalid access token.
2190
+ * Fix desktop notifications using libnotify (Linux/BSD).
2191
+ * `travis branches` preserves branch name when displaying Pull Request builds.
2192
+ * Add `travis setup modulus`.
2193
+ * Ruby library now supports build annotations.
2194
+ * Document plugin support.
2195
+ * Do not have the client raise on unknown API entities.
2196
+ * Do not try and resolve missing commit data (as it will lead to a 404).
2197
+
2198
+ **1.6.6** (December 16, 2013)
2199
+
2200
+ * Fix `travis login --pro` for new users.
2201
+
2202
+ **1.6.5** (December 16, 2013)
2203
+
2204
+ * Add `travis settings` command for accessing repository settings.
2205
+ * Add `travis setup opsworks`.
2206
+ * Add `travis console -x` to run a line of Ruby code with a valid session.
2207
+ * Add authentication and streaming example for Ruby library.
2208
+ * Add Ruby API for dealing with repository settings.
2209
+ * Improve `travis login` and `travis login --auto`. Add ability to load GitHub token from Keychain.
2210
+ * Only ask for GitHub two-factor auth token if two-factor auth is actually required.
2211
+ * Fix access right check for `travis caches`.
2212
+
2213
+ **1.6.4** (December 16, 2013)
2214
+
2215
+ Release was yanked. See 1.6.5 for changes.
2216
+
2217
+ **1.6.3** (November 27, 2013)
2218
+
2219
+ * Fix OS detection on Windows.
2220
+ * Add `travis repos` command.
2221
+ * Add `travis setup cloudfiles`.
2222
+ * Add `travis setup divshot`.
2223
+ * Add `--date` flag to `travis history`.
2224
+ * Add upload and target directory options to `travis setup s3`.
2225
+ * Include commit message in desktop notifications.
2226
+ * Check if Notification Center or Growl is actually running before sending out notifications.
2227
+ * Better documentation for desktop notifications.
2228
+ * Improved handling of pusher errors when streaming.
2229
+ * Add ability to load archived logs from different host.
2230
+ * User proper API endpoint for streaming logs, as old endpoint has been removed.
2231
+ * Make tests run on Rubinius 2.x.
2232
+
2233
+ **1.6.2** (November 8, 2013)
2234
+
2235
+ * Remove worker support, as API endpoints have been removed from Travis CI.
2236
+ * Improve OS detection.
2237
+ * Fix `travis report`.
2238
+ * Fix issues with new payload for permissions endpoint (used by `travis monitor`).
2239
+ * Improve default logic for whether `travis monitor` should display desktop notifications.
2240
+ * Make desktop notifications work on Mac OSX 10.9.
2241
+ * Increase and improve debug output.
2242
+ * Only load pry if console command is actually invoked, not when it is loaded (for instance by `travis help`).
2243
+
2244
+ **1.6.1** (November 4, 2013)
2245
+
2246
+ * Update autocompletion when updating travis gem.
2247
+
2248
+ **1.6.0** (November 4, 2013)
2249
+
2250
+ * Add `travis cache` to list and delete directory caches.
2251
+ * Add `travis report` to give a report of the system, endpoint, configuration and last exception.
2252
+ * Add `Cache` entity.
2253
+ * Keep `travis monitor` running on API errors.
2254
+
2255
+ **1.5.8** (October 24, 2013)
2256
+
2257
+ * Fix bug in completion code that stopped command line client from running.
2258
+
2259
+ **1.5.7** (October 24, 2013)
2260
+
2261
+ * Improve logic for automatically figuring out a repository slug based on the tracked git remote.
2262
+ * Display error if argument passed to `-r` is not a full slug.
2263
+ * Do not automatically install shell completion on gem installation.
2264
+ * Add Travis CI mascot as logo to desktop notifications.
2265
+ * Improve OSX and Growl notifications.
2266
+ * Require user to be logged in for all commands issued against an enterprise installation.
2267
+ * Improve error message when not logged in for enterprise installations.
2268
+ * Fix API endpoint detection for enterprise installations.
2269
+ * Make streaming API, and thus the `monitor` and `logs` command, work with enterprise installations.
2270
+ * Add `--build`, `--push` and `--pull` flags to monitor command to allow filtering events.
2271
+
2272
+ **1.5.6** (October 22, 2013)
2273
+
2274
+ * Add `travis setup appfog` and `travis setup s3`.
2275
+ * Use new API for fetching a single branch for Repository#branch. This also circumvents the 25 branches limit.
2276
+ * Start publishing gem prereleases after successful builds.
2277
+ * Have `travis logs` display first job for a build if a build number is given (or for the last build if called without arguments)
2278
+ * Add support for branch names to `travis logs`.
2279
+ * Add support for just using the job suffix with `travis logs`.
2280
+ * Improve error message if job cannot be found/identified by `travis logs`.
2281
+ * Add `travis logout` for removing access token.
2282
+ * Improve error message for commands that require user to be logged in.
2283
+ * Add `account` method for fetching a single account to `Travis::Client::Methods`.
2284
+ * Allow creating account objects for any account, not just these the user is part of. Add `Account#member?` to check for membership.
2285
+ * Add `Account#repositories` to load all repos for a given account.
2286
+ * Add `Repository#owner_name` and `Repository#owner` to load the account owning a repository.
2287
+ * Add `Repository#member?` to check if the current user is a member of a repository.
2288
+ * Add `Build#pull_request_number` and `Build#pull_request_title`.
2289
+ * Remove trailing new lines from string passed to `travis encrypt`.
2290
+ * Fix double `provider` entry generated by `travis setup engineyard`.
2291
+ * Only load auto-completions if available.
2292
+ * Fix and improve growl notifications.
2293
+ * Fix GitHub host detection `travis login --auto`.
2294
+ * API endpoint may now include a path all the requests will be prefixed with.
2295
+ * Allow overriding SSL options in Ruby client.
2296
+ * Add `--insecure` to turn off SSL verification.
2297
+ * Add `--enterprise`/`-X` option for Travis Enterprise integration.
2298
+
2299
+ **1.5.5** (October 2, 2013)
2300
+
2301
+ * Add `travis setup pypi`
2302
+ * Add `travis setup npm`
2303
+ * When loading accounts, set all flag to true.
2304
+ * Fix bug where session.config would be nil instead of a hash.
2305
+
2306
+ **1.5.4** (September 7, 2013)
2307
+
2308
+ * Make `travis monitor` send out desktop notifications.
2309
+ * List available templates on `travis init --help`.
2310
+ * List available services on `travis setup --help`.
2311
+ * Make `travis setup cloudfoundry` detect the target automatically if possible
2312
+ * Have `travis setup` ask if you want to deploy/release from current branch if not on master.
2313
+ * Give autocompletion on zsh [superpowers](http://ascii.io/a/5139).
2314
+ * Add `Repository#github_language`.
2315
+ * `travis init` now is smarter when it comes to detecting the template to use (ie, "CoffeeScript" will be mapped to "node_js")
2316
+ * Running `travis init` without a language will now use `Repository#github_language` as default language rather than ruby.
2317
+ * Make `travis login` and `travis login --auto` work with GitHub Enterprise.
2318
+ * Make `travis login` work with two factor authentication.
2319
+ * Add `travis endpoint --github`.
2320
+ * Make `travis accounts` handle accounts without name better.
2321
+
2322
+ **1.5.3** (August 22, 2013)
2323
+
2324
+ * Fix issues on Windows.
2325
+ * Improve `travis setup rubygems` (automatically figure out API token for newer RubyGems versions, offer to only release tagged commits, allow changing gem name).
2326
+ * Add command descriptions to help pages.
2327
+ * Smarter check if travis gem is outdated.
2328
+ * Better error messages for non-existing build/job numbers.
2329
+
2330
+ **1.5.2** (August 18, 2013)
2331
+
2332
+ * Add `travis cancel`.
2333
+ * Add `Build#cancel` and `Job#cancel` to Ruby API.
2334
+ * Add `travis setup cloudfoundry`.
2335
+ * Add `--set-default` and `--drop-default` to `travis endpoint`.
2336
+ * Make it possible to configure cli via env variables (`$TRAVIS_TOKEN`, `$TRAVIS_ENDPOINT` and `$TRAVIS_CONFIG_PATH`).
2337
+ * Improve `travis setup cloudcontrol`.
2338
+
2339
+ **1.5.1** (August 15, 2013)
2340
+
2341
+ * Add `travis setup engineyard`.
2342
+ * Add `travis setup cloudcontrol`.
2343
+ * Silence warnings when running `travis help` or `travis console`.
2344
+
2345
+ **1.5.0** (August 7, 2013)
2346
+
2347
+ * Add `travis setup rubygems`.
2348
+ * Add `travis accounts`.
2349
+ * Add `travis monitor`.
2350
+ * Make `travis logs` stream.
2351
+ * Add Broadcast entity.
2352
+ * Add streaming body API.
2353
+ * Add event listener API.
2354
+ * Add simple plugin system (will load any ~/.travis/*/init.rb when running cli).
2355
+ * Implement shell completion for bash and zsh.
2356
+ * Be smarter about warnings when running `travis encrypt`.
2357
+ * Improve documentation.
2358
+
2359
+ **1.4.0** (July 26, 2013)
2360
+
2361
+ * Add `travis init`
2362
+ * Improve install documentation, especially for people from outside the Ruby community
2363
+ * Improve error message on an expired token
2364
+ * Add Account entity to library
2365
+ * Switch to Typhoeus as default HTTP adapter
2366
+ * Fix tests for forks
2367
+
2368
+ **1.3.1** (July 21, 2013)
2369
+
2370
+ * Add `travis whatsup --my-repos`, which corresponds to the "My Repositories" tab in the web interface
2371
+ * 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`.
2372
+ * Add `--override` and `--append` to `travis encrypt`, make default behavior depend on key.
2373
+ * Add shorthand for `travis encrypt --add`.
2374
+
2375
+ **1.3.0** (July 20, 2013)
2376
+
2377
+ * Add `travis setup [heroku|openshift|nodejitsu|sauce_connect]`
2378
+ * Add `travis branches`
2379
+ * Add Repository#branch and Repository#branches
2380
+ * Improve `--help`
2381
+ * Improve error message when calling `travis logs` with a matrix build number
2382
+ * Check if travis gem is up to date from time to time (CLI only, not when used as library)
2383
+
2384
+ **1.2.8** (July 19, 2013)
2385
+
2386
+ * Make pubkey print out key in ssh encoding, add --pem flag for old format
2387
+ * Fix more encoding issues
2388
+ * Fix edge cases that broke history view
2389
+
2390
+ **1.2.7** (July 15, 2013)
2391
+
2392
+ * Add pubkey command
2393
+ * Remove all whitespace from an encrypted string
2394
+
2395
+ **v1.2.6** (July 7, 2013)
2396
+
2397
+ * Improve output of history command
2398
+
2399
+ **v1.2.5** (July 7, 2013)
2400
+
2401
+ * Fix encoding issue
2402
+
2403
+ **v1.2.4** (July 7, 2013)
2404
+
2405
+ * Allow empty commit message
2406
+
2407
+ **v1.2.3** (June 27, 2013)
2408
+
2409
+ * Fix encoding issue
2410
+ * Will detect github repo from other remotes besides origin
2411
+ * Add clear_cache(!) to Travis::Namespace
2412
+
2413
+ **v1.2.2** (May 24, 2013)
2414
+
2415
+ * Fixed `travis disable`.
2416
+ * Fix edge cases around `travis encrypt`.
2417
+
2418
+ **v1.2.1** (May 24, 2013)
2419
+
2420
+ * Builds with high build numbers are properly aligned when running `travis history`.
2421
+ * Don't lock against a specific backports version, makes it easier to use it as a Ruby library.
2422
+ * Fix encoding issues.
2423
+
2424
+ **v1.2.0** (February 22, 2013)
2425
+
2426
+ * add `--adapter` to API endpoints
2427
+ * added branch to `show`
2428
+ * fix bug where colors were not used if stdin is a pipe
2429
+ * make `encrypt` options `--split` and `--add` work together properly
2430
+ * better handling of missing or empty `.travis.yml` when running `encrypt --add`
2431
+ * fix broken example code
2432
+ * no longer require network connection to automatically detect repository slug
2433
+ * add worker support to the ruby library
2434
+ * adjust artifacts/logs code to upstream api changes
2435
+
2436
+ **v1.1.3** (January 26, 2013)
2437
+
2438
+ * use persistent HTTP connections (performance for commands with example api requests)
2439
+ * include round trip time in debug output
2440
+
2441
+ **v1.1.2** (January 24, 2013)
2442
+
2443
+ * `token` command
2444
+ * no longer wrap $stdin in delegator (caused bug on some Linux systems)
2445
+ * correctly detect when running on Windows, even on JRuby
2446
+
2447
+ **v1.1.1** (January 22, 2013)
2448
+
2449
+ * Make pry a runtime dependency rather than a development dependency.
2450
+
2451
+ **v1.1.0** (January 21, 2013)
2452
+
2453
+ * New commands: `console`, `status`, `show`, `logs`, `history`, `restart`, `sync`, `enable`, `disable`, `open` and `whatsup`.
2454
+ * `--debug` option for all API commands.
2455
+ * `--split` option for `encrypt`.
2456
+ * Fix `--add` option for `encrypt` (was naming key `secret` instead of `secure`).
2457
+ * First class representation for builds, commits and jobs in the Ruby library.
2458
+ * Print warning when running "encrypt owner/project data", as it's not supported by the new client.
2459
+ * Improved documentation.
2460
+
2461
+ **v1.0.3** (January 15, 2013)
2462
+
2463
+ * Fix `-r slug` for repository commands. (#3)
2464
+
2465
+ **v1.0.2** (January 14, 2013)
2466
+
2467
+ * Only bundle CA certs needed to verify Travis CI and GitHub domains.
2468
+ * Make tests pass on Windows.
2469
+
2470
+ **v1.0.1** (January 14, 2013)
2471
+
2472
+ * Improve `encrypt --add` behavior.
2473
+
2474
+ **v1.0.0** (January 14, 2013)
2475
+
2476
+ * Fist public release.
2477
+ * Improved documentation.
2478
+
2479
+ **v1.0.0pre2** (January 14, 2013)
2480
+
2481
+ * Added Windows support.
2482
+ * Suggestion to run `travis login` will add `--org` if needed.
2483
+
2484
+ **v1.0.0pre** (January 13, 2013)
2485
+
2486
+ * Initial public prerelease.