travis-akerl 1.8.9

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