travis 1.6.18.travis.596.5 → 1.6.18.travis.604.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +666 -426
- data/assets/travis.sh +63 -60
- data/examples/{cli.md → cli/encrypt_file.md} +27 -3
- data/examples/cli/private_dependencies.md +253 -0
- data/lib/travis/cli.rb +3 -2
- data/lib/travis/cli/command.rb +12 -1
- data/lib/travis/cli/encrypt_file.rb +140 -0
- data/lib/travis/cli/help.rb +1 -1
- data/lib/travis/cli/repo_command.rb +36 -5
- data/travis.gemspec +3 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OThiZTNlOGRhOWExNzhmNzYzZGE1ZmIxZGRmMmM5YTg1MWM0ZmNiNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTQxZGU4YjAwZTgzMzcyZDZhMmE5YjJiZWM2OGUxZjgzZjliZWY2YQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmU5NmE4ZGIwYzQwYTY1NDM5OTk2ZmRlZDI4ZTYwZjUzZWEwZTI4MzhkMDdi
|
10
|
+
Y2IzZTNiYTkyY2M1MmIwMzExMmU4OGZiNGFiOTFkZTI4NzFkYjI2NTg0NzVm
|
11
|
+
ZmUyNjJiMjc3YzQ0YmM3OTJlNDZjMWUxZGU5Zjc0Nzc4MWFlYTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGE1MWVhZWQ0ZjA2Njg1NDM0OTk1NzQ4OGQ4OWJlM2Q0N2YwYWZjNjViYjUz
|
14
|
+
MjUwNzMyOTYzYzM0NWMyNzZhNjM3Njc1ZjU5OTI1MGJhMThkMmEwZTdjOTcz
|
15
|
+
NWY5OWNmMzViYmMwNzEwYjNkNGVlMWJhNjFmOTIyMWQzNzJmZjQ=
|
data/README.md
CHANGED
@@ -31,6 +31,7 @@ The [travis gem](https://rubygems.org/gems/travis) includes both a [command line
|
|
31
31
|
* [`disable`](#disable) - disables a project
|
32
32
|
* [`enable`](#enable) - enables a project
|
33
33
|
* [`encrypt`](#encrypt) - encrypts values for the .travis.yml
|
34
|
+
* [`encrypt-file`](#encrypt-file) - encrypts a file and adds decryption steps to .travis.yml
|
34
35
|
* [`env`](#env) - show or modify build environment variables
|
35
36
|
* [`history`](#history) - displays a projects build history
|
36
37
|
* [`init`](#init) - generates a .travis.yml and enables the project
|
@@ -102,11 +103,13 @@ You probably want to use `--explode` if you are working on a patch for the Travi
|
|
102
103
|
|
103
104
|
The `help` command will inform you about the arguments and options that the commands take, for instance:
|
104
105
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
106
|
+
``` console
|
107
|
+
$ travis help help
|
108
|
+
Usage: travis help [command] [options]
|
109
|
+
-h, --help Display help
|
110
|
+
-i, --[no-]interactive be interactive and colorful
|
111
|
+
-E, --[no-]explode don't rescue exceptions
|
112
|
+
```
|
110
113
|
|
111
114
|
Running `help` without a command name will give you a list of all available commands.
|
112
115
|
|
@@ -133,23 +136,27 @@ The `--debug` option will print HTTP requests to STDERR. Like `--explode`, this
|
|
133
136
|
|
134
137
|
There are many libraries out there to do HTTP requests in Ruby. You can switch amongst common ones with `--adapter`:
|
135
138
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
139
|
+
``` console
|
140
|
+
$ travis show --adapter net-http
|
141
|
+
...
|
142
|
+
$ gem install excon
|
143
|
+
...
|
144
|
+
$ travis show --adapter excon
|
145
|
+
...
|
146
|
+
```
|
142
147
|
|
143
148
|
#### `accounts`
|
144
149
|
|
145
150
|
The accounts command can be used to list all the accounts you can set up repositories for.
|
146
151
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
152
|
+
``` console
|
153
|
+
$ travis accounts
|
154
|
+
rkh (Konstantin Haase): subscribed, 160 repositories
|
155
|
+
sinatra (Sinatra): subscribed, 9 repositories
|
156
|
+
rack (Official Rack repositories): subscribed, 3 repositories
|
157
|
+
travis-ci (Travis CI): subscribed, 57 repositories
|
158
|
+
...
|
159
|
+
```
|
153
160
|
|
154
161
|
#### `console`
|
155
162
|
|
@@ -157,50 +164,62 @@ Running `travis console` gives you an interactive Ruby session with all the [ent
|
|
157
164
|
|
158
165
|
But why use this over just `irb -r travis`? For one, it will take care of authentication, setting the correct endpoint, etc, and it also allows you to pass in `--debug` if you are curious as to what's actually going on.
|
159
166
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
+
``` console
|
168
|
+
$ travis console
|
169
|
+
>> User.current
|
170
|
+
=> #<User: rkh>
|
171
|
+
>> Repository.find('sinatra/sinatra')
|
172
|
+
=> #<Repository: sinatra/sinatra>
|
173
|
+
>> _.last_build
|
174
|
+
=> #<Travis::Client::Build: sinatra/sinatra#360>
|
175
|
+
```
|
167
176
|
|
168
177
|
#### `endpoint`
|
169
178
|
|
170
179
|
Prints out the API endpoint you're talking to.
|
171
180
|
|
172
|
-
|
173
|
-
|
181
|
+
``` console
|
182
|
+
$ travis endpoint
|
183
|
+
API endpoint: https://api.travis-ci.org/
|
184
|
+
```
|
174
185
|
|
175
186
|
Handy for using it when working with shell scripts:
|
176
187
|
|
177
|
-
|
188
|
+
``` console
|
189
|
+
$ curl "$(travis endpoint)/docs" > docs.html
|
190
|
+
```
|
178
191
|
|
179
192
|
It can also be used to set the default API endpoint used for [General API Commands](#general-api-commands):
|
180
193
|
|
181
|
-
|
182
|
-
|
194
|
+
``` console
|
195
|
+
$ travis endpoint --pro --set-default
|
196
|
+
API endpoint: https://api.travis-ci.com/ (stored as default)
|
197
|
+
```
|
183
198
|
|
184
199
|
You can use `--drop-default` to remove the setting again:
|
185
200
|
|
186
|
-
|
187
|
-
|
201
|
+
``` console
|
202
|
+
$ travis endpoint --drop-default
|
203
|
+
default API endpoint dropped (was https://api.travis-ci.com/)
|
204
|
+
```
|
188
205
|
|
189
206
|
#### `login`
|
190
207
|
|
191
208
|
The `login` command will, well, log you in. That way, all subsequent commands that run against the same endpoint will be authenticated.
|
192
209
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
210
|
+
``` console
|
211
|
+
$ travis login
|
212
|
+
We need your GitHub login to identify you.
|
213
|
+
This information will not be sent to Travis CI, only to GitHub.
|
214
|
+
The password will not be displayed.
|
197
215
|
|
198
|
-
|
216
|
+
Try running with --github-token or --auto if you don't want to enter your password anyway.
|
199
217
|
|
200
|
-
|
201
|
-
|
218
|
+
Username: rkh
|
219
|
+
Password: *******************
|
202
220
|
|
203
|
-
|
221
|
+
Successfully logged in!
|
222
|
+
```
|
204
223
|
|
205
224
|
As you can see above, it will ask you for your GitHub user name and password, but not send these to Travis CI. Instead, it will use them to create a GitHub API token, show the token to Travis, which then on its own checks if you really are who you say you are, and gives you an access token for the Travis API in return. The client will then delete the GitHub token again, just to be sure. But don't worry, all that happens under the hood and fully automatic.
|
206
225
|
|
@@ -212,8 +231,10 @@ A third option is for the really lazy: `--auto`. In this mode the client will tr
|
|
212
231
|
|
213
232
|
This command makes Travis CI forget your access token.
|
214
233
|
|
215
|
-
|
216
|
-
|
234
|
+
``` console
|
235
|
+
$ travis logout --pro
|
236
|
+
Successfully logged out!
|
237
|
+
```
|
217
238
|
|
218
239
|
#### `monitor`
|
219
240
|
|
@@ -230,6 +251,7 @@ This command makes Travis CI forget your access token.
|
|
230
251
|
-X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
|
231
252
|
-m, --my-repos Only monitor my own repositories
|
232
253
|
-r, --repo SLUG monitor given repository (can be used more than once)
|
254
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
233
255
|
-n, --[no-]notify [TYPE] send out desktop notifications (optional type: osx, growl, libnotify)
|
234
256
|
-b, --builds only monitor builds, not jobs
|
235
257
|
-p, --push monitor push events
|
@@ -237,31 +259,37 @@ This command makes Travis CI forget your access token.
|
|
237
259
|
|
238
260
|
With `monitor` you can watch a live stream of what's going on:
|
239
261
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
262
|
+
``` console
|
263
|
+
$ travis monitor
|
264
|
+
Monitoring travis-ci.org:
|
265
|
+
2013-08-05 01:22:40 questmaster/FATpRemote#45 started
|
266
|
+
2013-08-05 01:22:40 questmaster/FATpRemote#45.1 started
|
267
|
+
2013-08-05 01:22:41 grangier/python-goose#33.1 passed
|
268
|
+
2013-08-05 01:22:42 plataformatec/simple_form#666 passed
|
269
|
+
...
|
270
|
+
```
|
247
271
|
|
248
272
|
You can limit the repositories to monitor with `--my-repos` and `--repo SLUG`.
|
249
273
|
|
250
274
|
By default, you will receive events for both builds and jobs, you can limit it to builds only via `--build` (short `-b`):
|
251
275
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
276
|
+
``` console
|
277
|
+
$ travis monitor
|
278
|
+
Monitoring travis-ci.org:
|
279
|
+
2013-08-05 01:22:40 questmaster/FATpRemote#45 started
|
280
|
+
2013-08-05 01:22:42 plataformatec/simple_form#666 passed
|
281
|
+
...
|
282
|
+
```
|
257
283
|
|
258
284
|
Similarly, you can limit it to builds/jobs for pull requests via `--pull` and for normal pushes via `--push`.
|
259
285
|
|
260
286
|
The monitor command can also send out [desktop notifications](#desktop-notifications):
|
261
287
|
|
262
|
-
|
263
|
-
|
264
|
-
|
288
|
+
``` console
|
289
|
+
$ travis monitor --pro -n
|
290
|
+
Monitoring travis-ci.com:
|
291
|
+
...
|
292
|
+
```
|
265
293
|
|
266
294
|
When monitoring specific repositories, notifications will be turned on by default. Disable with `--no-notify`.
|
267
295
|
|
@@ -269,18 +297,20 @@ When monitoring specific repositories, notifications will be turned on by defaul
|
|
269
297
|
|
270
298
|
This is really helpful both when working on this client and when exploring the [Travis API](https://api.travis-ci.org). It will simply fire a request against the API endpoint, parse the output and pretty print it. Keep in mind that the client takes care of authentication for you:
|
271
299
|
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
300
|
+
``` console
|
301
|
+
$ travis raw /repos/travis-ci/travis.rb
|
302
|
+
{"repo"=>
|
303
|
+
{"id"=>409371,
|
304
|
+
"slug"=>"travis-ci/travis.rb",
|
305
|
+
"description"=>"Travis CI Client (CLI and Ruby library)",
|
306
|
+
"last_build_id"=>4251410,
|
307
|
+
"last_build_number"=>"77",
|
308
|
+
"last_build_state"=>"passed",
|
309
|
+
"last_build_duration"=>351,
|
310
|
+
"last_build_language"=>nil,
|
311
|
+
"last_build_started_at"=>"2013-01-19T18:00:49Z",
|
312
|
+
"last_build_finished_at"=>"2013-01-19T18:02:17Z"}}
|
313
|
+
```
|
284
314
|
|
285
315
|
Use `--json` if you'd rather prefer the output to be JSON.
|
286
316
|
|
@@ -288,36 +318,38 @@ Use `--json` if you'd rather prefer the output to be JSON.
|
|
288
318
|
|
289
319
|
When inspecting a bug or reporting an issue, it can be handy to include a report about the system and configuration used for running a command.
|
290
320
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
+
``` console
|
322
|
+
$ travis report --pro
|
323
|
+
System
|
324
|
+
Ruby: Ruby 2.0.0-p195
|
325
|
+
Operating System: Mac OS X 10.8.5
|
326
|
+
RubyGems: RubyGems 2.0.7
|
327
|
+
|
328
|
+
CLI
|
329
|
+
Version: 1.5.8
|
330
|
+
Plugins: "travis-as-user", "travis-build", "travis-cli-pr"
|
331
|
+
Auto-Completion: yes
|
332
|
+
Last Version Check: 2013-11-02 16:25:03 +0100
|
333
|
+
|
334
|
+
Session
|
335
|
+
API Endpoint: https://api.travis-ci.com/
|
336
|
+
Logged In: as "rkh"
|
337
|
+
Verify SSL: yes
|
338
|
+
Enterprise: no
|
339
|
+
|
340
|
+
Endpoints
|
341
|
+
pro: https://api.travis-ci.com/ (access token, current)
|
342
|
+
org: https://api.travis-ci.org/ (access token)
|
343
|
+
|
344
|
+
Last Exception
|
345
|
+
An error occurred running `travis whoami --pro`:
|
346
|
+
Travis::Client::Error: access denied
|
347
|
+
from ...
|
348
|
+
|
349
|
+
|
350
|
+
For issues with the command line tool, please visit https://github.com/travis-ci/travis.rb/issues.
|
351
|
+
For Travis CI in general, go to https://github.com/travis-ci/travis-ci/issues or email support@travis-ci.com.
|
352
|
+
```
|
321
353
|
|
322
354
|
This command can also list all known repos and the endpoint to use for them via the `--known-repos` option.
|
323
355
|
|
@@ -348,28 +380,32 @@ This command can also list all known repos and the endpoint to use for them via
|
|
348
380
|
|
349
381
|
Lists repositories and displays whether these are active or not. Has a variety of options to filter repositories.
|
350
382
|
|
351
|
-
|
352
|
-
|
353
|
-
|
383
|
+
``` console
|
384
|
+
$ travis repos -m 'rkh/travis-*'
|
385
|
+
rkh/travis-chat (active: yes, admin: yes, push: yes, pull: yes)
|
386
|
+
Description: example app demoing travis-sso usage
|
354
387
|
|
355
|
-
|
356
|
-
|
388
|
+
rkh/travis-encrypt (active: yes, admin: yes, push: yes, pull: yes)
|
389
|
+
Description: proof of concept in browser encryption of travis settings
|
357
390
|
|
358
|
-
|
359
|
-
|
391
|
+
rkh/travis-lite (active: no, admin: yes, push: yes, pull: yes)
|
392
|
+
Description: Travis CI without the JavaScript
|
360
393
|
|
361
|
-
|
362
|
-
|
394
|
+
rkh/travis-surveillance (active: no, admin: yes, push: yes, pull: yes)
|
395
|
+
Description: Veille sur un projet.
|
396
|
+
```
|
363
397
|
|
364
398
|
In non-interactive mode, it will only output the repository slug, which goes well with xargs:
|
365
399
|
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
400
|
+
``` console
|
401
|
+
$ travis repos --active --owner travis-ci | xargs -I % travis disable -r %
|
402
|
+
travis-ci/artifacts: disabled :(
|
403
|
+
travis-ci/canary: disabled :(
|
404
|
+
travis-ci/docs-travis-ci-com: disabled :(
|
405
|
+
travis-ci/dpl: disabled :(
|
406
|
+
travis-ci/gh: disabled :(
|
407
|
+
...
|
408
|
+
```
|
373
409
|
|
374
410
|
#### `sync`
|
375
411
|
|
@@ -388,18 +424,24 @@ In non-interactive mode, it will only output the repository slug, which goes wel
|
|
388
424
|
|
389
425
|
Sometimes the infos Travis CI has about users and repositories become out of date. If that should happen, you can manually trigger a sync:
|
390
426
|
|
391
|
-
|
392
|
-
|
427
|
+
``` console
|
428
|
+
$ travis sync
|
429
|
+
synchronizing: ........... done
|
430
|
+
```
|
393
431
|
|
394
432
|
The command blocks until the synchronization is done. You can avoid that with `--background`:
|
395
433
|
|
396
|
-
|
397
|
-
|
434
|
+
``` console
|
435
|
+
$ travis sync --background
|
436
|
+
starting synchronization
|
437
|
+
```
|
398
438
|
|
399
439
|
If you just want to know if your account is being synchronized right now, use `--check`:
|
400
440
|
|
401
|
-
|
402
|
-
|
441
|
+
``` console
|
442
|
+
$ travis sync --check
|
443
|
+
rkh is currently syncing
|
444
|
+
```
|
403
445
|
|
404
446
|
#### `lint`
|
405
447
|
|
@@ -407,37 +449,49 @@ This checks a `.travis.yml` file for any issues it might detect.
|
|
407
449
|
|
408
450
|
By default, it will read a file named `.travis.yml` in the current directory:
|
409
451
|
|
410
|
-
|
411
|
-
|
412
|
-
|
452
|
+
``` console
|
453
|
+
$ travis lint
|
454
|
+
Warnings for .travis.yml:
|
455
|
+
[x] your repository must be feature flagged for the os setting to be used
|
456
|
+
```
|
413
457
|
|
414
458
|
You can also give it a path to a different file:
|
415
459
|
|
416
|
-
|
417
|
-
|
460
|
+
``` console
|
461
|
+
$ travis lint example.yml
|
462
|
+
...
|
463
|
+
```
|
418
464
|
|
419
465
|
Or pipe the content into it:
|
420
466
|
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
467
|
+
``` console
|
468
|
+
$ echo "foo: bar" | travis lint
|
469
|
+
Warnings for STDIN:
|
470
|
+
[x] unexpected key foo, dropping
|
471
|
+
[x] missing key language, defaulting to ruby
|
472
|
+
```
|
425
473
|
|
426
474
|
Like the [`status` command](#status), you can use `-q` to suppress any output, and `-x` to have it set the exit code to 1 if there are any warnings.
|
427
475
|
|
428
|
-
|
476
|
+
``` console
|
477
|
+
$ travis lint -qx || echo ".travis.yml does not validate"
|
478
|
+
```
|
429
479
|
|
430
480
|
#### `token`
|
431
481
|
|
432
482
|
In order to use the Ruby library you will need to obtain an access token first. To do this simply run the `travis login` command. Once logged in you can check your token with `travis token`:
|
433
483
|
|
434
|
-
|
435
|
-
|
484
|
+
``` console
|
485
|
+
$ travis token
|
486
|
+
Your access token is super-secret
|
487
|
+
```
|
436
488
|
|
437
489
|
You can use that token for instance with curl:
|
438
490
|
|
439
|
-
|
440
|
-
|
491
|
+
``` console
|
492
|
+
$ curl -H "Authorization: token $(travis token)" https://api.travis-ci.org/users/
|
493
|
+
{"login":"rkh","name":"Konstantin Haase","email":"konstantin.haase@gmail.com","gravatar_id":"5c2b452f6eea4a6d84c105ebd971d2a4","locale":"en","is_syncing":false,"synced_at":"2013-01-21T20:31:06Z"}
|
494
|
+
```
|
441
495
|
|
442
496
|
Note that if you just need it for looking at API payloads, that we also have the [`raw`](#raw) command.
|
443
497
|
|
@@ -445,35 +499,43 @@ Note that if you just need it for looking at API payloads, that we also have the
|
|
445
499
|
|
446
500
|
It's just a tiny feature, but it allows you to take a look at repositories that have recently seen some action (ie the left hand sidebar on [travis-ci.org](https://travis-ci.org)):
|
447
501
|
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
502
|
+
``` console
|
503
|
+
$ travis whatsup
|
504
|
+
mysociety/fixmystreet started: #154
|
505
|
+
eloquent/typhoon started: #228
|
506
|
+
Pajk/apipie-rails started: #84
|
507
|
+
qcubed/framework failed: #21
|
508
|
+
...
|
509
|
+
```
|
454
510
|
|
455
511
|
If you only want to see what happened in your repositories, add the `--my-repos` flag (short: `-m`):
|
456
512
|
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
513
|
+
``` console
|
514
|
+
$ travis whatsup -m
|
515
|
+
travis-ci/travis.rb passed: #169
|
516
|
+
rkh/dpl passed: #50
|
517
|
+
rubinius/rubinius passed: #3235
|
518
|
+
sinatra/sinatra errored: #619
|
519
|
+
rtomayko/tilt failed: #162
|
520
|
+
ruby-no-kai/rubykaigi2013 passed: #50
|
521
|
+
rack/rack passed: #519
|
522
|
+
...
|
523
|
+
```
|
466
524
|
|
467
525
|
#### `whoami`
|
468
526
|
|
469
527
|
This command is useful to verify that you're in fact logged in:
|
470
528
|
|
471
|
-
|
472
|
-
|
529
|
+
``` console
|
530
|
+
$ travis whoami
|
531
|
+
You are rkh (Konstantin Haase)
|
532
|
+
```
|
473
533
|
|
474
534
|
Again, like most other commands, goes well with shell scripting:
|
475
535
|
|
476
|
-
|
536
|
+
``` console
|
537
|
+
$ git clone "https://github.com/$(travis whoami)/some_project"
|
538
|
+
```
|
477
539
|
|
478
540
|
### Repository Commands
|
479
541
|
|
@@ -490,10 +552,11 @@ Again, like most other commands, goes well with shell scripting:
|
|
490
552
|
--debug show API requests
|
491
553
|
-X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
|
492
554
|
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
555
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
493
556
|
|
494
557
|
Repository commands have all the options [General API Commands](#general-api-commands) have.
|
495
558
|
|
496
|
-
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.
|
559
|
+
Additionally, you can specify the Repository to talk to by providing `--repo owner/name`. However, if you invoke the command inside a clone of the project, the client will figure out this option on its own. Note that it uses the tracked [git remote](http://www.kernel.org/pub/software/scm/git/docs/git-remote.html) for the current branch (and defaults to 'origin' if no tracking is set) to do so. You can use `--store-repo SLUG` once to override it permanently.
|
497
560
|
|
498
561
|
It will also automatically pick [Travis Pro](https://travis-ci.com) if it is a private project. You can of course override this decission with `--pro`, `--org` or `--api-endpoint URL`
|
499
562
|
|
@@ -501,16 +564,18 @@ It will also automatically pick [Travis Pro](https://travis-ci.com) if it is a p
|
|
501
564
|
|
502
565
|
Displays the most recent build for each branch:
|
503
566
|
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
567
|
+
``` console
|
568
|
+
$ travis branches
|
569
|
+
hh-add-warning-old-style: #35 passed Add a warning if old-style encrypt is being used
|
570
|
+
hh-multiline-encrypt: #55 passed Merge branch 'master' into hh-multiline-encrypt
|
571
|
+
rkh-show-logs-history: #72 passed regenerate gemspec
|
572
|
+
rkh-debug: #75 passed what?
|
573
|
+
hh-add-clear-cache-to-global-session: #135 passed Add clear_cache(!) to Travis::Namespace
|
574
|
+
hh-annotations: #146 passed Initial annotation support
|
575
|
+
hh-remove-newlines-from-encrypted-string: #148 errored Remove all whitespace from an encrypted string
|
576
|
+
version-check: #157 passed check travis version for updates from time to time
|
577
|
+
master: #163 passed add Repository#branches and Repository#branch(name)
|
578
|
+
```
|
514
579
|
|
515
580
|
For more fine grained control and older builds on a specific branch, see [`history`](#history).
|
516
581
|
|
@@ -531,6 +596,7 @@ For more fine grained control and older builds on a specific branch, see [`histo
|
|
531
596
|
--debug show API requests
|
532
597
|
-X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
|
533
598
|
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
599
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
534
600
|
-d, --delete delete listed caches
|
535
601
|
-b, --branch BRANCH only list/delete caches on given branch
|
536
602
|
-m, --match STRING only list/delete caches where slug matches given string
|
@@ -538,81 +604,101 @@ For more fine grained control and older builds on a specific branch, see [`histo
|
|
538
604
|
|
539
605
|
Lists or deletes [directory caches](http://about.travis-ci.org/docs/user/caching/) for a repository:
|
540
606
|
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
607
|
+
``` console
|
608
|
+
$ travis cache
|
609
|
+
On branch master:
|
610
|
+
cache--rvm-2.0.0--gemfile-Gemfile last modified: 2013-11-04 13:45:44 size: 62.21 MiB
|
611
|
+
cache--rvm-ruby-head--gemfile-Gemfile last modified: 2013-11-04 13:46:55 size: 62.65 MiB
|
545
612
|
|
546
|
-
|
547
|
-
|
613
|
+
On branch example:
|
614
|
+
cache--rvm-2.0.0--gemfile-Gemfile last modified: 2013-11-04 13:45:44 size: 62.21 MiB
|
548
615
|
|
549
|
-
|
616
|
+
Overall size of above caches: 187.07 MiB
|
617
|
+
```
|
550
618
|
|
551
619
|
You can filter by branch:
|
552
620
|
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
621
|
+
``` console
|
622
|
+
$ travis cache --branch master
|
623
|
+
On branch master:
|
624
|
+
cache--rvm-2.0.0--gemfile-Gemfile last modified: 2013-11-04 13:45:44 size: 62.21 MiB
|
625
|
+
cache--rvm-ruby-head--gemfile-Gemfile last modified: 2013-11-04 13:46:55 size: 62.65 MiB
|
557
626
|
|
558
|
-
|
627
|
+
Overall size of above caches: 124.86 MiB
|
628
|
+
```
|
559
629
|
|
560
630
|
And by matching against the slug:
|
561
631
|
|
562
|
-
|
563
|
-
|
564
|
-
|
632
|
+
``` console
|
633
|
+
$ travis cache --match 2.0.0
|
634
|
+
On branch master:
|
635
|
+
cache--rvm-2.0.0--gemfile-Gemfile last modified: 2013-11-04 13:45:44 size: 62.21 MiB
|
565
636
|
|
566
|
-
|
637
|
+
Overall size of above caches: 62.21 MiB
|
638
|
+
```
|
567
639
|
|
568
640
|
You can also use this command to delete caches:
|
569
641
|
|
570
|
-
|
571
|
-
|
572
|
-
|
642
|
+
``` console
|
643
|
+
$ travis cache -b example -m 2.0.0 --delete
|
644
|
+
DANGER ZONE: Do you really want to delete all caches on branch example that match 2.0.0? |no| yes
|
645
|
+
Deleted the following caches:
|
573
646
|
|
574
|
-
|
575
|
-
|
647
|
+
On branch example:
|
648
|
+
cache--rvm-2.0.0--gemfile-Gemfile last modified: 2013-11-04 13:45:44 size: 62.21 MiB
|
576
649
|
|
577
|
-
|
650
|
+
Overall size of above caches: 62.21 MiB
|
651
|
+
```
|
578
652
|
|
579
653
|
#### `cancel`
|
580
654
|
|
581
655
|
This command will cancel the latest build:
|
582
656
|
|
583
|
-
|
584
|
-
|
657
|
+
``` console
|
658
|
+
$ travis cancel
|
659
|
+
build #85 has been canceled
|
660
|
+
```
|
585
661
|
|
586
662
|
You can also cancel any build by giving a build number:
|
587
663
|
|
588
|
-
|
589
|
-
|
664
|
+
``` console
|
665
|
+
$ travis cancel 57
|
666
|
+
build #57 has been canceled
|
667
|
+
```
|
590
668
|
|
591
669
|
Or a single job:
|
592
670
|
|
593
|
-
|
594
|
-
|
671
|
+
``` console
|
672
|
+
$ travis cancel 57.1
|
673
|
+
job #57.1 has been canceled
|
674
|
+
```
|
595
675
|
|
596
676
|
#### `disable`
|
597
677
|
|
598
678
|
If you want to turn of a repository temporarily or indefinitely, you can do so with the `disable` command:
|
599
679
|
|
600
|
-
|
601
|
-
|
680
|
+
``` console
|
681
|
+
$ travis disable
|
682
|
+
travis-ci/travis.rb: disabled :(
|
683
|
+
```
|
602
684
|
|
603
685
|
#### `enable`
|
604
686
|
|
605
687
|
With the `enable` command, you can easily activate a project on Travis CI:
|
606
688
|
|
607
|
-
|
608
|
-
|
689
|
+
``` console
|
690
|
+
$ travis enable
|
691
|
+
travis-ci/travis.rb: enabled :)
|
692
|
+
```
|
609
693
|
|
610
694
|
It even works when enabling a repo Travis didn't know existed by triggering a sync:
|
611
695
|
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
696
|
+
``` console
|
697
|
+
$ travis enable -r rkh/test
|
698
|
+
repository not known to Travis CI (or no access?)
|
699
|
+
triggering sync: ............. done
|
700
|
+
rkh/test: enabled
|
701
|
+
```
|
616
702
|
|
617
703
|
If you don't want the sync to be triggered, use `--skip-sync`.
|
618
704
|
|
@@ -630,6 +716,7 @@ If you don't want the sync to be triggered, use `--skip-sync`.
|
|
630
716
|
--debug show API requests
|
631
717
|
--adapter ADAPTER Faraday adapter to use for HTTP requests
|
632
718
|
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
719
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
633
720
|
-a, --add [KEY] adds it to .travis.yml under KEY (default: env.global)
|
634
721
|
-s, --[no-]split treat each line as a separate input
|
635
722
|
-p, --append don't override existing values, instead treat as list
|
@@ -637,40 +724,108 @@ If you don't want the sync to be triggered, use `--skip-sync`.
|
|
637
724
|
|
638
725
|
This command is useful to encrypt [environment variables](http://about.travis-ci.org/docs/user/encryption-keys/) or deploy keys for private dependencies.
|
639
726
|
|
640
|
-
|
641
|
-
|
727
|
+
``` console
|
728
|
+
$ travis encrypt FOO=bar
|
729
|
+
Please add the following to your .travis.yml file:
|
642
730
|
|
643
|
-
|
731
|
+
secure: "gSly+Kvzd5uSul15CVaEV91ALwsGSU7yJLHSK0vk+oqjmLm0jp05iiKfs08j\n/Wo0DG8l4O9WT0mCEnMoMBwX4GiK4mUmGdKt0R2/2IAea+M44kBoKsiRM7R3\n+62xEl0q9Wzt8Aw3GCDY4XnoCyirO49DpCH6a9JEAfILY/n6qF8="
|
644
732
|
|
645
|
-
|
733
|
+
Pro Tip™: You can add it automatically by running with --add.
|
734
|
+
```
|
646
735
|
|
647
736
|
For deploy keys, it is really handy to pipe them into the command:
|
648
737
|
|
649
|
-
|
738
|
+
``` console
|
739
|
+
$ cat id_rsa | travis encrypt
|
740
|
+
```
|
650
741
|
|
651
742
|
Another use case for piping files into it: If you have a file with sensitive environment variables, like foreman's [.env](http://ddollar.github.com/foreman/#ENVIRONMENT) file, you can add tell the client to encrypt every line separately via `--split`:
|
652
743
|
|
653
|
-
|
654
|
-
|
744
|
+
``` console
|
745
|
+
$ cat .env | travis encrypt --split
|
746
|
+
Please add the following to your .travis.yml file:
|
655
747
|
|
656
|
-
|
657
|
-
|
748
|
+
secure: "KmMdcwTWGubXVRu93/lY1NtyHxrjHK4TzCfemgwjsYzPcZuPmEA+pz+umQBN\n1ZhzUHZwDNsDd2VnBgYq27ZdcS2cRvtyI/IFuM/xJoRi0jpdTn/KsXR47zeE\nr2bFxRqrdY0fERVHSMkBiBrN/KV5T70js4Y6FydsWaQgXCg+WEU="
|
749
|
+
secure: "jAglFtDjncy4E3upL/RF0ZOcmJ2UMrqHFCLQwU8PBdurhTMBeTw+IO6cXx5z\nU5zqvPYo/ghZ8mMuUhvHiGDM6m6OlMP7+l10VTxH1CoVew2NcQvRdfK3P+4S\nZJ43Hyh/ZLCjft+JK0tBwoa3VbH2+ZTzkRZQjdg54bE16C7Mf1A="
|
658
750
|
|
659
|
-
|
751
|
+
Pro Tip: You can add it automatically by running with --add.
|
752
|
+
```
|
660
753
|
|
661
754
|
As suggested, the client can also add them to your `.travis.yml` for you:
|
662
755
|
|
663
|
-
|
756
|
+
``` console
|
757
|
+
$ travis encrypt FOO=bar --add
|
758
|
+
```
|
664
759
|
|
665
760
|
This will by default add it as global variables for every job. You can also add it as matrix entries by providing a key:
|
666
761
|
|
667
|
-
|
762
|
+
``` console
|
763
|
+
$ travis encrypt FOO=bar --add env.matrix
|
764
|
+
```
|
668
765
|
|
669
766
|
There are two ways the client can treat existing values:
|
670
767
|
|
671
768
|
* Turn existing value into a list if it isn't already, append new value to that list. This is the default behavior for keys that start with `env.` and can be enforced with `--append`.
|
672
769
|
* Replace existing value. This is the default behavior for keys that do not start with `env.` and can be enforced with `--override`.
|
673
770
|
|
771
|
+
#### `encrypt-file`
|
772
|
+
|
773
|
+
Encrypts a file and adds decryption steps to .travis.yml.
|
774
|
+
Usage: travis encrypt-file INPUT_PATH [OUTPUT_PATH] [OPTIONS]
|
775
|
+
-h, --help Display help
|
776
|
+
-i, --[no-]interactive be interactive and colorful
|
777
|
+
-E, --[no-]explode don't rescue exceptions
|
778
|
+
--skip-version-check don't check if travis client is up to date
|
779
|
+
--skip-completion-check don't check if auto-completion is set up
|
780
|
+
-e, --api-endpoint URL Travis API server to talk to
|
781
|
+
-I, --[no-]insecure do not verify SSL certificate of API endpoint
|
782
|
+
--pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
|
783
|
+
--org short-cut for --api-endpoint 'https://api.travis-ci.org/'
|
784
|
+
-t, --token [ACCESS_TOKEN] access token to use
|
785
|
+
--debug show API requests
|
786
|
+
-X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
|
787
|
+
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
788
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
789
|
+
-K, --key KEY encryption key to be used (randomly generated otherwise)
|
790
|
+
--iv IV encryption IV to be used (randomly generated otherwise)
|
791
|
+
-d, --decrypt decrypt the file instead of encrypting it, requires key and iv
|
792
|
+
-f, --force override output file if it exists
|
793
|
+
-p, --print-key print (possibly generated) key and iv
|
794
|
+
-w, --decrypt-to PATH where to write the decrypted file to on the Travis CI VM
|
795
|
+
-a, --add [STAGE] automatically add command to .travis.yml (default stage is before_install)
|
796
|
+
|
797
|
+
This command will encrypt a file for you using a symmetric encryption (AES-256), and it will store the secret in a [secure variable](#env). It will output the command you can use in your build script to decrypt the file.
|
798
|
+
|
799
|
+
``` console
|
800
|
+
$ travis encrypt-file bacon.txt
|
801
|
+
encrypting bacon.txt for rkh/travis-encrypt-file-example
|
802
|
+
storing result as bacon.txt.enc
|
803
|
+
storing secure env variables for decryption
|
804
|
+
|
805
|
+
Please add the following to your build scirpt (before_install stage in your .travis.yml, for instance):
|
806
|
+
|
807
|
+
openssl aes-256-cbc -K $encrypted_0a6446eb3ae3_key -iv $encrypted_0a6446eb3ae3_key -in bacon.txt.enc -out bacon.txt -d
|
808
|
+
|
809
|
+
Pro Tip: You can add it automatically by running with --add.
|
810
|
+
|
811
|
+
Make sure to add bacon.txt.enc to the git repository.
|
812
|
+
Make sure not to add bacon.txt to the git repository.
|
813
|
+
Commit all changes to your .travis.yml.
|
814
|
+
```
|
815
|
+
|
816
|
+
You can also use `--add` to have it automatically add the decrypt command to your `.travis.yml`
|
817
|
+
|
818
|
+
``` console
|
819
|
+
$ travis encrypt-file bacon.txt --add
|
820
|
+
encrypting bacon.txt for rkh/travis-encrypt-file-example
|
821
|
+
storing result as bacon.txt.enc
|
822
|
+
storing secure env variables for decryption
|
823
|
+
|
824
|
+
Make sure to add bacon.txt.enc to the git repository.
|
825
|
+
Make sure not to add bacon.txt to the git repository.
|
826
|
+
Commit all changes to your .travis.yml.
|
827
|
+
```
|
828
|
+
|
674
829
|
#### `env`
|
675
830
|
|
676
831
|
Show or modify build environment variables.
|
@@ -696,32 +851,32 @@ There are two ways the client can treat existing values:
|
|
696
851
|
--adapter ADAPTER Faraday adapter to use for HTTP requests
|
697
852
|
--as USER authenticate as given user
|
698
853
|
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
854
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
699
855
|
-P, --[no-]public make new values public
|
700
856
|
-p, --[no-]private make new values private
|
701
857
|
-u, --[no-]unescape do not escape values
|
702
858
|
|
703
859
|
You can set, list and unset environment variables, or copy them from the current environment:
|
704
860
|
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
[x] removing environment variable $bar
|
861
|
+
``` console
|
862
|
+
$ travis env set foo bar --public
|
863
|
+
[+] setting environment variable $foo
|
864
|
+
$ travis env list
|
865
|
+
# environment variables for travis-ci/travis.rb
|
866
|
+
foo=bar
|
867
|
+
|
868
|
+
$ export foo=foobar
|
869
|
+
$ travis env copy foo bar
|
870
|
+
[+] setting environment variable $foo
|
871
|
+
[+] setting environment variable $bar
|
872
|
+
$ travis env list
|
873
|
+
# environment variables for travis-ci/travis.rb
|
874
|
+
foo=foobar
|
875
|
+
bar=[secure]
|
876
|
+
$ travis env unset foo bar
|
877
|
+
[x] removing environment variable $foo
|
878
|
+
[x] removing environment variable $bar
|
879
|
+
```
|
725
880
|
|
726
881
|
#### `history`
|
727
882
|
|
@@ -740,6 +895,7 @@ You can set, list and unset environment variables, or copy them from the current
|
|
740
895
|
--debug show API requests
|
741
896
|
-X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
|
742
897
|
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
898
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
743
899
|
-a, --after BUILD Only show history after a given build number
|
744
900
|
-p, --pull-request NUMBER Only show history for the given Pull Request
|
745
901
|
-b, --branch BRANCH Only show history for the given branch
|
@@ -749,43 +905,53 @@ You can set, list and unset environment variables, or copy them from the current
|
|
749
905
|
|
750
906
|
You can check out what the recent builds look like:
|
751
907
|
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
908
|
+
``` console
|
909
|
+
$ travis history
|
910
|
+
#77 passed: master fix name clash
|
911
|
+
#76 failed: master Merge pull request #11 from travis-ci/rkh-show-logs-history
|
912
|
+
#75 passed: rkh-debug what?
|
913
|
+
#74 passed: rkh-debug all tests pass locally and on the travis vm I spin up :(
|
914
|
+
#73 failed: Pull Request #11 regenerate gemspec
|
915
|
+
#72 passed: rkh-show-logs-history regenerate gemspec
|
916
|
+
#71 failed: Pull Request #11 spec fix for (older) rubinius
|
917
|
+
#70 passed: rkh-show-logs-history spec fix for (older) rubinius
|
918
|
+
#69 failed: Pull Request #11 strange fix for rubinius
|
919
|
+
#68 failed: rkh-show-logs-history strange fix for rubinius
|
920
|
+
```
|
763
921
|
|
764
922
|
By default, it will display the last 10 builds. You can limit (or extend) the number of builds with `--limit`:
|
765
923
|
|
766
|
-
|
767
|
-
|
768
|
-
|
924
|
+
``` console
|
925
|
+
$ travis history --limit 2
|
926
|
+
#77 passed: master fix name clash
|
927
|
+
#76 failed: master Merge pull request #11 from travis-ci/rkh-show-logs-history
|
928
|
+
```
|
769
929
|
|
770
930
|
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):
|
771
931
|
|
772
|
-
|
773
|
-
|
774
|
-
|
932
|
+
``` console
|
933
|
+
$ travis history --limit 2 --after 76
|
934
|
+
#75 passed: rkh-debug what?
|
935
|
+
#74 passed: rkh-debug all tests pass locally and on the travis vm I spin up :(
|
936
|
+
```
|
775
937
|
|
776
938
|
You can also limit the history to builds for a certain branch:
|
777
939
|
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
940
|
+
``` console
|
941
|
+
$ travis history --limit 3 --branch master
|
942
|
+
#77 passed: master fix name clash
|
943
|
+
#76 failed: master Merge pull request #11 from travis-ci/rkh-show-logs-history
|
944
|
+
#57 passed: master Merge pull request #5 from travis-ci/hh-multiline-encrypt
|
945
|
+
```
|
782
946
|
|
783
947
|
Or a certain Pull Request:
|
784
948
|
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
949
|
+
``` console
|
950
|
+
$ travis history --limit 3 --pull-request 5
|
951
|
+
#56 passed: Pull Request #5 Merge branch 'master' into hh-multiline-encrypt
|
952
|
+
#49 passed: Pull Request #5 improve output
|
953
|
+
#48 passed: Pull Request #5 let it generate accessor for line splitting automatically
|
954
|
+
```
|
789
955
|
|
790
956
|
#### `init`
|
791
957
|
|
@@ -801,6 +967,7 @@ Or a certain Pull Request:
|
|
801
967
|
--debug show API requests
|
802
968
|
--adapter ADAPTER Faraday adapter to use for HTTP requests
|
803
969
|
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
970
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
804
971
|
-s, --skip-sync don't trigger a sync if the repo is unknown
|
805
972
|
-f, --force override .travis.yml if it already exists
|
806
973
|
-k, --skip-enable do not enable project, only add .travis.yml
|
@@ -826,108 +993,133 @@ Or a certain Pull Request:
|
|
826
993
|
|
827
994
|
When setting up a new project, you can run `travis init` to generate a `.travis.yml` and [enable](#enable) the project:
|
828
995
|
|
829
|
-
|
830
|
-
|
831
|
-
|
996
|
+
``` console
|
997
|
+
$ travis init java
|
998
|
+
.travis.yml file created!
|
999
|
+
travis-ci/java-example: enabled :)
|
1000
|
+
```
|
832
1001
|
|
833
1002
|
You can also set certain values via command line flags (see list above):
|
834
1003
|
|
835
|
-
|
836
|
-
|
837
|
-
|
1004
|
+
``` console
|
1005
|
+
$ travis init c --compiler clang
|
1006
|
+
.travis.yml file created!
|
1007
|
+
travis-ci/c-example: enabled :)
|
1008
|
+
```
|
838
1009
|
|
839
1010
|
#### `logs`
|
840
1011
|
|
841
1012
|
Given a job number, logs simply prints out that job's logs. By default it will display the first job of the latest build.
|
842
1013
|
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
1014
|
+
``` console
|
1015
|
+
$ travis logs
|
1016
|
+
displaying logs for travis-ci/travis.rb#317.1
|
1017
|
+
[... more logs ...]
|
1018
|
+
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
|
1019
|
+
$ bundle exec rake
|
1020
|
+
/home/travis/.rvm/rubies/ruby-1.8.7-p371/bin/ruby -S rspec spec -c
|
1021
|
+
..............................................................................................................................................................................................................................................................................
|
850
1022
|
|
851
|
-
|
852
|
-
|
1023
|
+
Finished in 4.46 seconds
|
1024
|
+
270 examples, 0 failures
|
853
1025
|
|
854
|
-
|
1026
|
+
Done. Build script exited with: 0
|
1027
|
+
```
|
855
1028
|
|
856
1029
|
The info line about the job being displayed is written to stderr, the logs itself are written to stdout.
|
857
1030
|
|
858
1031
|
It takes an optional argument that can be a job number:
|
859
1032
|
|
860
|
-
|
861
|
-
|
1033
|
+
``` console
|
1034
|
+
$ travis logs 100.3
|
1035
|
+
displaying logs for travis-ci/travis.rb#100.3
|
1036
|
+
```
|
862
1037
|
|
863
1038
|
A build number (in which case it will pick the build's first job):
|
864
1039
|
|
865
|
-
|
866
|
-
|
1040
|
+
``` console
|
1041
|
+
$ travis logs 100
|
1042
|
+
displaying logs for travis-ci/travis.rb#100.1
|
1043
|
+
```
|
867
1044
|
|
868
1045
|
Just the job suffix, which will pick the corresponding job from the latest build:
|
869
1046
|
|
870
|
-
|
871
|
-
|
1047
|
+
``` console
|
1048
|
+
$ travis logs .2
|
1049
|
+
displaying logs for travis-ci/travis.rb#317.2
|
1050
|
+
```
|
872
1051
|
|
873
1052
|
A branch name:
|
874
1053
|
|
875
|
-
|
876
|
-
|
1054
|
+
``` console
|
1055
|
+
$ travis logs ghe
|
1056
|
+
displaying logs for travis-ci/travis.rb#270.1
|
1057
|
+
```
|
877
1058
|
|
878
1059
|
You can delete the logs with the `--delete` flag, which optionally takes a reason as argument:
|
879
1060
|
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
1061
|
+
``` console
|
1062
|
+
$ travis logs --delete
|
1063
|
+
DANGER ZONE: Do you really want to delete the build log for travis-ci/travis.rb#559.1? |no| yes
|
1064
|
+
deleting log for travis-ci/travis.rb#559.1
|
1065
|
+
$ travis logs 1.7 --delete "contained confidential data" --force
|
1066
|
+
deleting log for travis-ci/travis.rb#1.7
|
1067
|
+
```
|
886
1068
|
|
887
1069
|
#### `open`
|
888
1070
|
|
889
1071
|
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:
|
890
1072
|
|
891
|
-
|
1073
|
+
``` console
|
1074
|
+
$ travis open
|
1075
|
+
```
|
892
1076
|
|
893
1077
|
If you just want the URL printed out instead of opened in a browser, pass `--print`.
|
894
1078
|
|
895
1079
|
If instead you want to open the repository, compare or pull request view on GitHub, use `--github`.
|
896
1080
|
|
897
|
-
|
898
|
-
|
1081
|
+
``` console
|
1082
|
+
$ travis open 56 --print --github
|
1083
|
+
web view: https://github.com/travis-ci/travis.rb/pull/5
|
1084
|
+
```
|
899
1085
|
|
900
1086
|
#### `pubkey`
|
901
1087
|
|
902
1088
|
Outputs the public key for a repository.
|
903
1089
|
|
904
|
-
|
905
|
-
|
1090
|
+
``` console
|
1091
|
+
$ travis pubkey
|
1092
|
+
Public key for travis-ci/travis.rb:
|
906
1093
|
|
907
|
-
|
908
|
-
|
1094
|
+
ssh-rsa ...
|
1095
|
+
$ travis pubkey -r rails/rails > rails.key
|
1096
|
+
```
|
909
1097
|
|
910
1098
|
The `--pem` flag will print out the key PEM encoded:
|
911
1099
|
|
912
|
-
|
913
|
-
|
1100
|
+
``` console
|
1101
|
+
$ travis pubkey --pem
|
1102
|
+
Public key for travis-ci/travis.rb:
|
914
1103
|
|
915
|
-
|
916
|
-
|
917
|
-
|
1104
|
+
-----BEGIN PUBLIC KEY-----
|
1105
|
+
...
|
1106
|
+
-----END PUBLIC KEY-----
|
1107
|
+
```
|
918
1108
|
|
919
1109
|
#### `requests`
|
920
1110
|
|
921
1111
|
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.
|
922
1112
|
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
1113
|
+
``` console
|
1114
|
+
$ travis requests -r sinatra/sinatra
|
1115
|
+
push to master accepted (triggered new build)
|
1116
|
+
abc51e2 - Merge pull request #847 from gogotanaka/add_readme_ja
|
1117
|
+
received at: 2014-02-16 09:26:36
|
927
1118
|
|
928
|
-
|
929
|
-
|
930
|
-
|
1119
|
+
PR #843 rejected (skipped through commit message)
|
1120
|
+
752201c - Update Spanish README with tense, verb, and word corrections. [ci skip]
|
1121
|
+
received at: 2014-02-16 05:07:16
|
1122
|
+
```
|
931
1123
|
|
932
1124
|
You can use `-l`/`--limit` to limit the number of requests displayed.
|
933
1125
|
|
@@ -935,54 +1127,68 @@ You can use `-l`/`--limit` to limit the number of requests displayed.
|
|
935
1127
|
|
936
1128
|
This command will restart the latest build:
|
937
1129
|
|
938
|
-
|
939
|
-
|
1130
|
+
``` console
|
1131
|
+
$ travis restart
|
1132
|
+
build #85 has been restarted
|
1133
|
+
```
|
940
1134
|
|
941
1135
|
You can also restart any build by giving a build number:
|
942
1136
|
|
943
|
-
|
944
|
-
|
1137
|
+
``` console
|
1138
|
+
$ travis restart 57
|
1139
|
+
build #57 has been restarted
|
1140
|
+
```
|
945
1141
|
|
946
1142
|
Or a single job:
|
947
1143
|
|
948
|
-
|
949
|
-
|
1144
|
+
``` console
|
1145
|
+
$ travis restart 57.1
|
1146
|
+
job #57.1 has been restarted
|
1147
|
+
```
|
950
1148
|
|
951
1149
|
##### `settings`
|
952
1150
|
|
953
1151
|
Certain repository settings can be read via the CLI:
|
954
1152
|
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
1153
|
+
``` console
|
1154
|
+
$ travis settings
|
1155
|
+
Settings for travis-ci/travis.rb:
|
1156
|
+
[-] builds_only_with_travis_yml Only run builds with a .travis.yml
|
1157
|
+
[+] build_pushes Build pushes
|
1158
|
+
[+] build_pull_requests Build pull requests
|
1159
|
+
[-] maximum_number_of_builds Maximum number of concurrent builds
|
1160
|
+
```
|
961
1161
|
|
962
1162
|
You can also filter the settings by passing them in as arguments:
|
963
1163
|
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
1164
|
+
``` console
|
1165
|
+
$ travis settings build_pushes build_pull_requests
|
1166
|
+
Settings for travis-ci/travis.rb:
|
1167
|
+
[+] build_pushes Build pushes
|
1168
|
+
[+] build_pull_requests Build pull requests
|
1169
|
+
```
|
968
1170
|
|
969
1171
|
It is also possible to change these settings via `--enable`, `--disable` and `--set`:
|
970
1172
|
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
1173
|
+
``` console
|
1174
|
+
$ travis settings build_pushes --disable
|
1175
|
+
Settings for travis-ci/travis.rb:
|
1176
|
+
[-] build_pushes Build pushes
|
1177
|
+
$ travis settings maximum_number_of_builds --set 1
|
1178
|
+
Settings for travis-ci/travis.rb:
|
1179
|
+
1 maximum_number_of_builds Maximum number of concurrent builds
|
1180
|
+
```
|
977
1181
|
|
978
1182
|
Or, alternatively, you can use `-c` to configure the settings interactively:
|
979
1183
|
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
1184
|
+
``` console
|
1185
|
+
$ travis settings -c
|
1186
|
+
Settings for travis-ci/travis.rb:
|
1187
|
+
Only run builds with a .travis.yml? |yes| no
|
1188
|
+
Build pushes? |no| yes
|
1189
|
+
Build pull requests? |yes|
|
1190
|
+
Maximum number of concurrent builds: |1| 5
|
1191
|
+
```
|
986
1192
|
|
987
1193
|
#### `setup`
|
988
1194
|
|
@@ -1000,85 +1206,96 @@ Helps you configure Travis addons.
|
|
1000
1206
|
--debug show API requests
|
1001
1207
|
--adapter ADAPTER Faraday adapter to use for HTTP requests
|
1002
1208
|
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
1209
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
1003
1210
|
-f, --force override config section if it already exists
|
1004
1211
|
|
1005
1212
|
Available services: `appfog`, `artifacts`, `cloudcontrol`, `cloudfiles`, `cloudfoundry`, `cloud66`, `deis`, `divshot`, `engineyard`, `gcs`, `hackage`, `heroku`, `modulus`, `npm`, `ninefold`, `nodejitsu`, `openshift`, `opsworks`, `pypi`, `releases`, `rubygems`, `s3` and `sauce_connect`.
|
1006
1213
|
|
1007
1214
|
Example:
|
1008
1215
|
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1216
|
+
``` console
|
1217
|
+
$ travis setup heroku
|
1218
|
+
Deploy only from travis-ci/travis-chat? |yes|
|
1219
|
+
Encrypt API key? |yes|
|
1220
|
+
```
|
1012
1221
|
|
1013
1222
|
#### `show`
|
1014
1223
|
|
1015
1224
|
Displays general infos about the latest build:
|
1016
1225
|
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1226
|
+
``` console
|
1227
|
+
$ travis show
|
1228
|
+
Build #77: fix name clash
|
1229
|
+
State: passed
|
1230
|
+
Type: push
|
1231
|
+
Compare URL: https://github.com/travis-ci/travis.rb/compare/7cc9b739b0b6...39b66ee24abe
|
1232
|
+
Duration: 5 min 51 sec
|
1233
|
+
Started: 2013-01-19 19:00:49
|
1234
|
+
Finished: 2013-01-19 19:02:17
|
1235
|
+
|
1236
|
+
#77.1 passed: 45 sec rvm: 1.8.7
|
1237
|
+
#77.2 passed: 50 sec rvm: 1.9.2
|
1238
|
+
#77.3 passed: 45 sec rvm: 1.9.3
|
1239
|
+
#77.4 passed: 46 sec rvm: 2.0.0
|
1240
|
+
#77.5 failed: 1 min 18 sec rvm: jruby (failure allowed)
|
1241
|
+
#77.6 passed: 1 min 27 sec rvm: rbx
|
1242
|
+
```
|
1032
1243
|
|
1033
1244
|
Any other build:
|
1034
1245
|
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1246
|
+
``` console
|
1247
|
+
$ travis show 1
|
1248
|
+
Build #1: add .travis.yml
|
1249
|
+
State: failed
|
1250
|
+
Type: push
|
1251
|
+
Compare URL: https://github.com/travis-ci/travis.rb/compare/ad817bc37c76...b8c5d3b463e2
|
1252
|
+
Duration: 3 min 16 sec
|
1253
|
+
Started: 2013-01-13 23:15:22
|
1254
|
+
Finished: 2013-01-13 23:21:38
|
1255
|
+
|
1256
|
+
#1.1 failed: 21 sec rvm: 1.8.7
|
1257
|
+
#1.2 failed: 34 sec rvm: 1.9.2
|
1258
|
+
#1.3 failed: 24 sec rvm: 1.9.3
|
1259
|
+
#1.4 failed: 52 sec rvm: 2.0.0
|
1260
|
+
#1.5 failed: 38 sec rvm: jruby
|
1261
|
+
#1.6 failed: 27 sec rvm: rbx
|
1262
|
+
```
|
1050
1263
|
|
1051
1264
|
The last build for a given branch:
|
1052
1265
|
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1266
|
+
``` console
|
1267
|
+
$ travis show rkh-debug
|
1268
|
+
Build #75: what?
|
1269
|
+
State: passed
|
1270
|
+
Type: push
|
1271
|
+
Branch: rkh-debug
|
1272
|
+
Compare URL: https://github.com/travis-ci/travis.rb/compare/8d4aa5254359...7ef33d5e5993
|
1273
|
+
Duration: 6 min 16 sec
|
1274
|
+
Started: 2013-01-19 18:51:17
|
1275
|
+
Finished: 2013-01-19 18:52:43
|
1276
|
+
|
1277
|
+
#75.1 passed: 1 min 10 sec rvm: 1.8.7
|
1278
|
+
#75.2 passed: 51 sec rvm: 1.9.2
|
1279
|
+
#75.3 passed: 36 sec rvm: 1.9.3
|
1280
|
+
#75.4 passed: 48 sec rvm: 2.0.0
|
1281
|
+
#75.5 failed: 1 min 26 sec rvm: jruby (failure allowed)
|
1282
|
+
#75.6 passed: 1 min 25 sec rvm: rbx
|
1283
|
+
```
|
1069
1284
|
|
1070
1285
|
Or a job:
|
1071
1286
|
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1287
|
+
``` console
|
1288
|
+
$ travis show 77.3
|
1289
|
+
Job #77.3: fix name clash
|
1290
|
+
State: passed
|
1291
|
+
Type: push
|
1292
|
+
Compare URL: https://github.com/travis-ci/travis.rb/compare/7cc9b739b0b6...39b66ee24abe
|
1293
|
+
Duration: 45 sec
|
1294
|
+
Started: 2013-01-19 19:00:49
|
1295
|
+
Finished: 2013-01-19 19:01:34
|
1296
|
+
Allow Failure: false
|
1297
|
+
Config: rvm: 1.9.3
|
1298
|
+
```
|
1082
1299
|
|
1083
1300
|
#### `sshkey`
|
1084
1301
|
|
@@ -1095,6 +1312,7 @@ Or a job:
|
|
1095
1312
|
--debug show API requests
|
1096
1313
|
-X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
|
1097
1314
|
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
1315
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
1098
1316
|
-D, --delete remove SSH key
|
1099
1317
|
-d, --description DESCRIPTION set description
|
1100
1318
|
-u, --upload FILE upload key from given file
|
@@ -1106,36 +1324,46 @@ Or a job:
|
|
1106
1324
|
|
1107
1325
|
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.
|
1108
1326
|
|
1109
|
-
|
1110
|
-
|
1327
|
+
``` console
|
1328
|
+
$ travis sshkey
|
1329
|
+
No custom SSH key installed.
|
1330
|
+
```
|
1111
1331
|
|
1112
1332
|
You can also use it to upload an SSH key:
|
1113
1333
|
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1334
|
+
``` console
|
1335
|
+
$ travis sshkey --upload ~/.ssh/id_rsa
|
1336
|
+
Key description: Test Key
|
1337
|
+
updating ssh key for travis-pro/test-project with key from /Users/konstantin/.ssh/id_rsa
|
1338
|
+
Current SSH key: Test Key
|
1339
|
+
```
|
1118
1340
|
|
1119
1341
|
And to remove it again:
|
1120
1342
|
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1343
|
+
``` console
|
1344
|
+
$ travis sshkey --delete
|
1345
|
+
DANGER ZONE: Remove SSH key for travis-pro/test-project? |no| yes
|
1346
|
+
removing ssh key for travis-pro/test-project
|
1347
|
+
No custom SSH key installed.
|
1348
|
+
```
|
1125
1349
|
|
1126
1350
|
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:
|
1127
1351
|
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1352
|
+
``` console
|
1353
|
+
$ travis sshkey --generate
|
1354
|
+
We need the GitHub login for the account you want to add the key to.
|
1355
|
+
This information will not be sent to Travis CI, only to api.github.com.
|
1356
|
+
The password will not be displayed.
|
1357
|
+
|
1358
|
+
Username: travisbot
|
1359
|
+
Password for travisbot: **************
|
1360
|
+
|
1361
|
+
Generating RSA key.
|
1362
|
+
Uploading public key to GitHub.
|
1363
|
+
Uploading private key to Travis CI.
|
1364
|
+
```
|
1365
|
+
|
1366
|
+
See the [private dependencies example](examples/cli/private_dependencies.md) for an in-detail description.
|
1139
1367
|
|
1140
1368
|
#### `status`
|
1141
1369
|
|
@@ -1148,36 +1376,45 @@ You can also have it generate a key for a given GitHub user (for instance, for a
|
|
1148
1376
|
--org short-cut for --api-endpoint 'https://api.travis-ci.org/'
|
1149
1377
|
-t, --token [ACCESS_TOKEN] access token to use
|
1150
1378
|
--debug show API requests
|
1151
|
-
-r, --repo SLUG
|
1379
|
+
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
1380
|
+
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
1152
1381
|
-x, --[no-]exit-code sets the exit code to 1 if the build failed
|
1153
1382
|
-q, --[no-]quiet does not print anything
|
1154
1383
|
-p, --[no-]fail-pending sets the status code to 1 if the build is pending
|
1155
1384
|
|
1156
1385
|
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.
|
1157
1386
|
|
1158
|
-
|
1387
|
+
``` console
|
1388
|
+
$ travis status -qpx && cap deploy
|
1389
|
+
```
|
1159
1390
|
|
1160
1391
|
### Pro and Enterprise
|
1161
1392
|
|
1162
1393
|
By default, [General API Commands](#general-api-commands) will talk to [api.travis-ci.org](https://api.travis-ci.org). You can change this by supplying `--pro` for [api.travis-ci.com](https://api.travis-ci.com) or `--api-endpoint` with your own endpoint. Note that all [Repository Commands](#repository-commands) will try to figure out the API endpoint to talk to automatically depending on the project's visibility on GitHub.
|
1163
1394
|
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1395
|
+
``` console
|
1396
|
+
$ travis login --pro
|
1397
|
+
...
|
1398
|
+
$ travis monitor --pro -m
|
1399
|
+
...
|
1400
|
+
```
|
1168
1401
|
|
1169
1402
|
The custom `--api-endpoint` option is handy for local development:
|
1170
1403
|
|
1171
|
-
|
1172
|
-
|
1404
|
+
``` console
|
1405
|
+
$ travis whatsup --api-endpoint http://localhost:3000
|
1406
|
+
...
|
1407
|
+
```
|
1173
1408
|
|
1174
1409
|
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.
|
1175
1410
|
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1411
|
+
``` console
|
1412
|
+
$ travis login -X
|
1413
|
+
Enterprise domain: travisci.example.com
|
1414
|
+
...
|
1415
|
+
$ travis whatsup -X
|
1416
|
+
...
|
1417
|
+
```
|
1181
1418
|
|
1182
1419
|
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.
|
1183
1420
|
|
@@ -1795,6 +2032,9 @@ If you have the old `travis-cli` gem installed, you should `gem uninstall travis
|
|
1795
2032
|
|
1796
2033
|
**1.6.18** (not yet released)
|
1797
2034
|
|
2035
|
+
* Add `travis encrypt-file`.
|
2036
|
+
* Add `--store-repo`/`-R` to repository commands to permanently store the slug for a repository.
|
2037
|
+
* Announce repository slug when first detected, ask for confirmation in interactive mode.
|
1798
2038
|
* Have `travis repos` only print repository slugs in non-interactive mode.
|
1799
2039
|
|
1800
2040
|
**1.6.17** (July 25, 2014)
|