travis 1.6.4.travis.413.4 → 1.6.4.travis.414.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +8 -2
- data/lib/travis/cli/settings.rb +54 -0
- data/lib/travis/cli/setup/opsworks.rb +22 -0
- data/lib/travis/client/settings.rb +25 -0
- data/lib/travis/tools/github.rb +2 -2
- data/travis.gemspec +12 -7
- metadata +14 -9
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjRjNjRiMmY4NGFkYTAxZjI0OTEzM2QyMDg1MmY4MWI5YzRkNDgwNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmUyZDZiMjU2MDlmODdjNGVlM2EzODJmNjlmZjU3ZTA4MmUzNWY2Nw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjY5Mjc1MDJjODdiZjkxZjA3Yjk0OGJlYmQ1NWQ3NmJjZmU1NDMzNGQzN2Jl
|
10
|
+
MmE0Y2FkOTViNzVjMWI1NTkyZjk1ZmM2ODkzZmY3YWE2ZmZhZDBlODVhZDYx
|
11
|
+
ZmQyMmE4NTc2MDBjNzQyNWZmOWI0ODgwYjQ1MTdhN2U3MjQzMDI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzQ2YzRjNjQ1M2YwYzQzYTBjNDIyZjMwZTFmZjQxZDIyYTFlM2NlYjE3MTE2
|
14
|
+
OTdlN2VkZTU4NDdlYjdiY2ZmMmRjMjM4MTdhNjI3ZGE3NGQ5MjYyNmFhYjI2
|
15
|
+
ODU0NmRiMDJjMDJiYmNjNGNiYjg4Y2IwNmEwMDU0MjQ2MzY4OTY=
|
data/README.md
CHANGED
@@ -1349,7 +1349,7 @@ repo.delete_caches(branch: "master", match: "rbx")
|
|
1349
1349
|
|
1350
1350
|
#### Repository Settings
|
1351
1351
|
|
1352
|
-
You can access a repositories settings
|
1352
|
+
You can access a repositories settings via `Repository#settings`:
|
1353
1353
|
|
1354
1354
|
``` ruby
|
1355
1355
|
require 'travis'
|
@@ -1535,9 +1535,15 @@ If you have the old `travis-cli` gem installed, you should `gem uninstall travis
|
|
1535
1535
|
|
1536
1536
|
## Version History
|
1537
1537
|
|
1538
|
-
**
|
1538
|
+
**1.6.4** (not yet released)
|
1539
1539
|
|
1540
|
+
* Add `travis settings` command for accessing repository settings.
|
1540
1541
|
* Add `travis setup opsworks`.
|
1542
|
+
* Add `travis console -x` to run a line of Ruby code with a valid session.
|
1543
|
+
* Add Ruby API for dealing with repository settings.
|
1544
|
+
* Improve `travis login` and `travis login --auto`. Add ability to load GitHub token from Keychain.
|
1545
|
+
* Only ask for GitHub two-factor auth token if two-factor auth is actually required.
|
1546
|
+
* Fix access right check for `travis caches`.
|
1541
1547
|
|
1542
1548
|
**1.6.3** (November 27, 2013)
|
1543
1549
|
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'travis/cli'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Settings < RepoCommand
|
6
|
+
attr_accessor :setting
|
7
|
+
|
8
|
+
description "access repository settings"
|
9
|
+
on('--keys', 'always use setting key instead of description')
|
10
|
+
on('-t', '--enable', 'enable the setting(s)') { |c| c.setting = true }
|
11
|
+
on('-f', '--disable', 'disable the setting(s)') { |c| c.setting = false }
|
12
|
+
on('-c', '--configure', 'change settings interactively')
|
13
|
+
|
14
|
+
DESCRIPTIONS = {
|
15
|
+
:builds_only_with_travis_yml => "Only run builds with a .travis.yml",
|
16
|
+
:build_pushes => "Build pushes",
|
17
|
+
:build_pull_requests => "Build pull requests"
|
18
|
+
}
|
19
|
+
|
20
|
+
def run(*keys)
|
21
|
+
exit 1 if interactive? and keys.empty? and !setting.nil? and !all_settings? and !configure?
|
22
|
+
authenticate
|
23
|
+
say repository.slug, "Settings for %s:"
|
24
|
+
repository.settings.to_h.each do |key, value|
|
25
|
+
next unless keys.empty? or keys.include? key
|
26
|
+
if configure?
|
27
|
+
repository.settings[key] = agree("#{describe(key, "enable #{key}")}? ") do |q|
|
28
|
+
default = setting.nil? ? value : setting
|
29
|
+
q.default = default ? "yes" : "no"
|
30
|
+
end
|
31
|
+
else
|
32
|
+
value = repository.settings[key] = setting unless setting.nil?
|
33
|
+
descr = color(describe(key, color(key, :info)) { |s| key.ljust(30) + " " + color(s, [:reset, :bold]) }, :info)
|
34
|
+
say color("[#{value ? "+" : "-"}] ", [:bold, value ? :green : :red]) << descr
|
35
|
+
end
|
36
|
+
end
|
37
|
+
repository.settings.save if configure? or !setting.nil?
|
38
|
+
end
|
39
|
+
|
40
|
+
def all_settings?
|
41
|
+
agree("Really #{setting ? "enable" : "disable"} all settings? ") do |q|
|
42
|
+
q.default = "no"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def describe(key, description = key)
|
47
|
+
return description if keys?
|
48
|
+
desc = DESCRIPTIONS[key.to_sym]
|
49
|
+
desc &&= yield(desc) if block_given?
|
50
|
+
desc || description
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class OpsWorks < Service
|
7
|
+
description "deployment to OpsWorks"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'opsworks' do |config|
|
11
|
+
config['access_key_id'] = ask("Access key ID: ").to_s
|
12
|
+
config['secret_access_key'] = ask("Secret access key: ") { |q| q.echo = "*" }.to_s
|
13
|
+
config['app-id'] = ask("App ID: ").to_s
|
14
|
+
on("Migrate the database? ", config, 'migrate' => true)
|
15
|
+
|
16
|
+
encrypt(config, 'secret_access_key') if agree("Encrypt secret access key? ") { |q| q.default = 'yes' }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'travis/client/weak_entity'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module Travis
|
5
|
+
module Client
|
6
|
+
class Settings < WeakEntity
|
7
|
+
attr_accessor :repository
|
8
|
+
# @!parse attr_reader :builds_only_with_travis_yml, :build_pushes, :build_pull_requests
|
9
|
+
attributes :builds_only_with_travis_yml, :build_pushes, :build_pull_requests
|
10
|
+
one :settings
|
11
|
+
many :settings
|
12
|
+
|
13
|
+
def save
|
14
|
+
raise "repository unknown" unless repository
|
15
|
+
result = session.patch("/repos/#{repository.id}/settings", JSON.dump("settings" => attributes))
|
16
|
+
attributes.replace(result['settings'].attributes)
|
17
|
+
self
|
18
|
+
end
|
19
|
+
|
20
|
+
def inspect_info
|
21
|
+
repository ? repository.slug : repository
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/travis/tools/github.rb
CHANGED
@@ -196,10 +196,10 @@ module Travis
|
|
196
196
|
opt[:headers] = { "X-GitHub-OTP" => otp } if otp
|
197
197
|
gh = GH.with(opt)
|
198
198
|
reply = gh.post('/authorizations', :scopes => scopes, :note => note)
|
199
|
-
self.callback = proc { gh.delete reply['_links']['self']['href'] }
|
199
|
+
self.callback = proc { gh.delete reply['_links']['self']['href'] } if drop_token
|
200
200
|
reply['token']
|
201
201
|
rescue GH::Error => error
|
202
|
-
if error.info[:response_status] == 401
|
202
|
+
if error.info[:response_status] == 401 and error.info[:response_headers]['x-github-otp'].to_s =~ /required/
|
203
203
|
login(user, password, die, ask_otp.call(user))
|
204
204
|
elsif die
|
205
205
|
raise gh_error(error)
|
data/travis.gemspec
CHANGED
@@ -17,8 +17,8 @@ Gem::Specification.new do |s|
|
|
17
17
|
"Peter Souter",
|
18
18
|
"Peter van Dijk",
|
19
19
|
"Max Barnash",
|
20
|
-
"Mathias Meyer",
|
21
20
|
"joshua-anderson",
|
21
|
+
"Mathias Meyer",
|
22
22
|
"Justin Lambert",
|
23
23
|
"Adrien Brault",
|
24
24
|
"Laurent Petit",
|
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
"Piotr Sarnacki",
|
29
29
|
"Rapha\xC3\xABl Pinson",
|
30
30
|
"Tobias Wilken",
|
31
|
+
"jeffdh",
|
31
32
|
"Daniel Chatfield",
|
32
33
|
"Adam Lavin",
|
33
34
|
"Benjamin Manns",
|
@@ -43,23 +44,24 @@ Gem::Specification.new do |s|
|
|
43
44
|
"p.morsou@gmail.com",
|
44
45
|
"henrik@hodne.io",
|
45
46
|
"peter.van.dijk@netherlabs.nl",
|
47
|
+
"j@zatigo.com",
|
46
48
|
"i.am@anhero.ru",
|
47
49
|
"meyer@paperplanes.de",
|
48
|
-
"
|
49
|
-
"benmanns@gmail.com",
|
50
|
+
"adam@lavoaster.co.uk",
|
50
51
|
"adrien.brault@gmail.com",
|
51
52
|
"laurent.petit@gmail.com",
|
52
53
|
"maartenvanvliet@gmail.com",
|
53
54
|
"mario@mariovisic.com",
|
55
|
+
"jlambert@eml.cc",
|
56
|
+
"josh.kalderimis@gmail.com",
|
54
57
|
"neamar@neamar.fr",
|
58
|
+
"jburkhart@engineyard.com",
|
55
59
|
"drogus@gmail.com",
|
56
60
|
"raphael.pinson@camptocamp.com",
|
57
61
|
"tw@cloudcontrol.de",
|
58
|
-
"
|
62
|
+
"jeffdh@gmail.com",
|
59
63
|
"chatfielddaniel@gmail.com",
|
60
|
-
"
|
61
|
-
"josh.kalderimis@gmail.com",
|
62
|
-
"jlambert@eml.cc"
|
64
|
+
"benmanns@gmail.com"
|
63
65
|
]
|
64
66
|
|
65
67
|
# generated from git ls-files
|
@@ -125,6 +127,7 @@ Gem::Specification.new do |s|
|
|
125
127
|
"lib/travis/cli/report.rb",
|
126
128
|
"lib/travis/cli/repos.rb",
|
127
129
|
"lib/travis/cli/restart.rb",
|
130
|
+
"lib/travis/cli/settings.rb",
|
128
131
|
"lib/travis/cli/setup.rb",
|
129
132
|
"lib/travis/cli/setup/appfog.rb",
|
130
133
|
"lib/travis/cli/setup/cloud_control.rb",
|
@@ -136,6 +139,7 @@ Gem::Specification.new do |s|
|
|
136
139
|
"lib/travis/cli/setup/nodejitsu.rb",
|
137
140
|
"lib/travis/cli/setup/npm.rb",
|
138
141
|
"lib/travis/cli/setup/open_shift.rb",
|
142
|
+
"lib/travis/cli/setup/opsworks.rb",
|
139
143
|
"lib/travis/cli/setup/pypi.rb",
|
140
144
|
"lib/travis/cli/setup/ruby_gems.rb",
|
141
145
|
"lib/travis/cli/setup/s3.rb",
|
@@ -164,6 +168,7 @@ Gem::Specification.new do |s|
|
|
164
168
|
"lib/travis/client/repository.rb",
|
165
169
|
"lib/travis/client/restartable.rb",
|
166
170
|
"lib/travis/client/session.rb",
|
171
|
+
"lib/travis/client/settings.rb",
|
167
172
|
"lib/travis/client/states.rb",
|
168
173
|
"lib/travis/client/user.rb",
|
169
174
|
"lib/travis/client/weak_entity.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: travis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.4.travis.
|
4
|
+
version: 1.6.4.travis.414.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
@@ -10,8 +10,8 @@ authors:
|
|
10
10
|
- Peter Souter
|
11
11
|
- Peter van Dijk
|
12
12
|
- Max Barnash
|
13
|
-
- Mathias Meyer
|
14
13
|
- joshua-anderson
|
14
|
+
- Mathias Meyer
|
15
15
|
- Justin Lambert
|
16
16
|
- Adrien Brault
|
17
17
|
- Laurent Petit
|
@@ -21,6 +21,7 @@ authors:
|
|
21
21
|
- Piotr Sarnacki
|
22
22
|
- Raphaël Pinson
|
23
23
|
- Tobias Wilken
|
24
|
+
- jeffdh
|
24
25
|
- Daniel Chatfield
|
25
26
|
- Adam Lavin
|
26
27
|
- Benjamin Manns
|
@@ -29,7 +30,7 @@ authors:
|
|
29
30
|
autorequire:
|
30
31
|
bindir: bin
|
31
32
|
cert_chain: []
|
32
|
-
date: 2013-12-
|
33
|
+
date: 2013-12-15 00:00:00.000000000 Z
|
33
34
|
dependencies:
|
34
35
|
- !ruby/object:Gem::Dependency
|
35
36
|
name: faraday
|
@@ -235,23 +236,24 @@ email:
|
|
235
236
|
- p.morsou@gmail.com
|
236
237
|
- henrik@hodne.io
|
237
238
|
- peter.van.dijk@netherlabs.nl
|
239
|
+
- j@zatigo.com
|
238
240
|
- i.am@anhero.ru
|
239
241
|
- meyer@paperplanes.de
|
240
|
-
-
|
241
|
-
- benmanns@gmail.com
|
242
|
+
- adam@lavoaster.co.uk
|
242
243
|
- adrien.brault@gmail.com
|
243
244
|
- laurent.petit@gmail.com
|
244
245
|
- maartenvanvliet@gmail.com
|
245
246
|
- mario@mariovisic.com
|
247
|
+
- jlambert@eml.cc
|
248
|
+
- josh.kalderimis@gmail.com
|
246
249
|
- neamar@neamar.fr
|
250
|
+
- jburkhart@engineyard.com
|
247
251
|
- drogus@gmail.com
|
248
252
|
- raphael.pinson@camptocamp.com
|
249
253
|
- tw@cloudcontrol.de
|
250
|
-
-
|
254
|
+
- jeffdh@gmail.com
|
251
255
|
- chatfielddaniel@gmail.com
|
252
|
-
-
|
253
|
-
- josh.kalderimis@gmail.com
|
254
|
-
- jlambert@eml.cc
|
256
|
+
- benmanns@gmail.com
|
255
257
|
executables:
|
256
258
|
- travis
|
257
259
|
extensions: []
|
@@ -318,6 +320,7 @@ files:
|
|
318
320
|
- lib/travis/cli/report.rb
|
319
321
|
- lib/travis/cli/repos.rb
|
320
322
|
- lib/travis/cli/restart.rb
|
323
|
+
- lib/travis/cli/settings.rb
|
321
324
|
- lib/travis/cli/setup.rb
|
322
325
|
- lib/travis/cli/setup/appfog.rb
|
323
326
|
- lib/travis/cli/setup/cloud_control.rb
|
@@ -329,6 +332,7 @@ files:
|
|
329
332
|
- lib/travis/cli/setup/nodejitsu.rb
|
330
333
|
- lib/travis/cli/setup/npm.rb
|
331
334
|
- lib/travis/cli/setup/open_shift.rb
|
335
|
+
- lib/travis/cli/setup/opsworks.rb
|
332
336
|
- lib/travis/cli/setup/pypi.rb
|
333
337
|
- lib/travis/cli/setup/ruby_gems.rb
|
334
338
|
- lib/travis/cli/setup/s3.rb
|
@@ -357,6 +361,7 @@ files:
|
|
357
361
|
- lib/travis/client/repository.rb
|
358
362
|
- lib/travis/client/restartable.rb
|
359
363
|
- lib/travis/client/session.rb
|
364
|
+
- lib/travis/client/settings.rb
|
360
365
|
- lib/travis/client/states.rb
|
361
366
|
- lib/travis/client/user.rb
|
362
367
|
- lib/travis/client/weak_entity.rb
|