travis 1.8.12.travis.1125.9 → 1.8.12.travis.1135.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/lib/travis/cli/encrypt.rb +2 -1
- data/lib/travis/cli/encrypt_file.rb +5 -3
- data/lib/travis/cli/repo_command.rb +15 -0
- data/spec/cli/encrypt_file_spec.rb +6 -0
- data/spec/cli/encrypt_spec.rb +19 -1
- data/travis.gemspec +0 -4
- metadata +2 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98ff67975fb9af7a0957bebd3ee9733f885cd0242d369e4ff64c3583704dc565
|
4
|
+
data.tar.gz: e1cce3560b3909aa43f0d39c8aa3dc4508748b745c5eefae2b518c4ec70d5e4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35d92350223b69aa6bd9bdcbe49a3e8401f70607bb20e215a80349f8ebcd488a35371d8759fd4e5161df09abececbf67a1bdc246d0dcaec254af9f7a80219268
|
7
|
+
data.tar.gz: 24c09e191559256014c7ec83e4739e8638acf1ee721dcd7f2ec353c7f4b0641f9ebb2df387f4573c9d1a01d66f50a2875e972a6f5f497e98423560b798c15705
|
data/README.md
CHANGED
@@ -705,16 +705,23 @@ If you don't want the sync to be triggered, use `--skip-sync`.
|
|
705
705
|
|
706
706
|
#### `encrypt`
|
707
707
|
|
708
|
-
|
708
|
+
Encrypts values for the .travis.yml.
|
709
|
+
Usage: travis encrypt [ARGS..] [OPTIONS]
|
709
710
|
-h, --help Display help
|
710
711
|
-i, --[no-]interactive be interactive and colorful
|
711
712
|
-E, --[no-]explode don't rescue exceptions
|
712
713
|
--skip-version-check don't check if travis client is up to date
|
714
|
+
--skip-completion-check don't check if auto-completion is set up
|
713
715
|
-e, --api-endpoint URL Travis API server to talk to
|
716
|
+
-I, --[no-]insecure do not verify SSL certificate of API endpoint
|
717
|
+
--pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
|
714
718
|
--com short-cut for --api-endpoint 'https://api.travis-ci.com/'
|
715
719
|
--org short-cut for --api-endpoint 'https://api.travis-ci.org/'
|
720
|
+
--staging talks to staging system
|
716
721
|
-t, --token [ACCESS_TOKEN] access token to use
|
717
722
|
--debug show API requests
|
723
|
+
--debug-http show HTTP(S) exchange
|
724
|
+
-X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
|
718
725
|
--adapter ADAPTER Faraday adapter to use for HTTP requests
|
719
726
|
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
720
727
|
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
@@ -780,11 +787,15 @@ There are two ways the client can treat existing values:
|
|
780
787
|
--skip-completion-check don't check if auto-completion is set up
|
781
788
|
-e, --api-endpoint URL Travis API server to talk to
|
782
789
|
-I, --[no-]insecure do not verify SSL certificate of API endpoint
|
790
|
+
--pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
|
783
791
|
--com short-cut for --api-endpoint 'https://api.travis-ci.com/'
|
784
792
|
--org short-cut for --api-endpoint 'https://api.travis-ci.org/'
|
793
|
+
--staging talks to staging system
|
785
794
|
-t, --token [ACCESS_TOKEN] access token to use
|
786
795
|
--debug show API requests
|
796
|
+
--debug-http show HTTP(S) exchange
|
787
797
|
-X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
|
798
|
+
--adapter ADAPTER Faraday adapter to use for HTTP requests
|
788
799
|
-r, --repo SLUG repository to use (will try to detect from current git clone)
|
789
800
|
-R, --store-repo SLUG like --repo, but remembers value for current directory
|
790
801
|
-K, --key KEY encryption key to be used (randomly generated otherwise)
|
data/lib/travis/cli/encrypt.rb
CHANGED
@@ -16,6 +16,7 @@ module Travis
|
|
16
16
|
on('-x', '--override', "override existing value")
|
17
17
|
|
18
18
|
def run(*args)
|
19
|
+
confirm = force_interactive.nil? || force_interactive
|
19
20
|
error "cannot combine --override and --append" if append? and override?
|
20
21
|
error "--append without --add makes no sense" if append? and not add?
|
21
22
|
error "--override without --add makes no sense" if override? and not add?
|
@@ -41,7 +42,7 @@ module Travis
|
|
41
42
|
|
42
43
|
if config_key
|
43
44
|
set_config encrypted.map { |e| { 'secure' => e } }
|
44
|
-
|
45
|
+
confirm_and_save_travis_config confirm
|
45
46
|
else
|
46
47
|
list = encrypted.map { |data| format(data.inspect, " secure: %s") }
|
47
48
|
say(list.join("\n"), template(__FILE__), :none)
|
@@ -23,6 +23,8 @@ module Travis
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def run(input_path, output_path = nil)
|
26
|
+
confirm = force_interactive.nil? || force_interactive
|
27
|
+
|
26
28
|
self.decrypt_to ||= decrypt_to_for(input_path)
|
27
29
|
output_path ||= File.basename(output_path_for(input_path))
|
28
30
|
self.output = $stdout.tty? ? StringIO.new : $stderr if output_path == '-'
|
@@ -40,7 +42,7 @@ module Travis
|
|
40
42
|
set_env_vars(input_path)
|
41
43
|
|
42
44
|
command = decrypt_command(output_path)
|
43
|
-
stage ? store_command(command) : print_command(command)
|
45
|
+
stage ? store_command(command, confirm) : print_command(command)
|
44
46
|
|
45
47
|
notes(input_path, output_path)
|
46
48
|
end
|
@@ -59,11 +61,11 @@ module Travis
|
|
59
61
|
say command, template(__FILE__)
|
60
62
|
end
|
61
63
|
|
62
|
-
def store_command(command)
|
64
|
+
def store_command(command, confirm)
|
63
65
|
travis_config[stage] = Array(travis_config[stage])
|
64
66
|
travis_config[stage].delete(command)
|
65
67
|
travis_config[stage].unshift(command)
|
66
|
-
|
68
|
+
confirm_and_save_travis_config confirm
|
67
69
|
end
|
68
70
|
|
69
71
|
def decrypt_command(path)
|
@@ -143,6 +143,21 @@ module Travis
|
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
146
|
+
def confirm_and_save_travis_config(confirm = true, file = travis_yaml)
|
147
|
+
if confirm
|
148
|
+
ans = ask [
|
149
|
+
nil,
|
150
|
+
color("Overwrite the config file #{travis_yaml} with the content below?", [:info, :yellow]),
|
151
|
+
color("This reformats the existing file.", [:info, :red]),
|
152
|
+
travis_config.to_yaml,
|
153
|
+
color("(y/N)", [:info, :yellow])
|
154
|
+
].join("\n\n")
|
155
|
+
confirm = ans =~ /^y/i
|
156
|
+
end
|
157
|
+
|
158
|
+
save_travis_config if confirm
|
159
|
+
end
|
160
|
+
|
146
161
|
def save_travis_config(file = travis_yaml)
|
147
162
|
yaml = travis_config.to_yaml
|
148
163
|
yaml.gsub! /^(\s+)('on'|true):/, "\\1on:"
|
@@ -17,4 +17,10 @@ describe Travis::CLI::EncryptFile do
|
|
17
17
|
run_cli('encrypt-file', CMD_TARGET).should be_success
|
18
18
|
File.exists?("#{CMD_TARGET}.enc").should be true
|
19
19
|
end
|
20
|
+
|
21
|
+
example "travis encrypt-file #{CMD_TARGET} -a" do
|
22
|
+
run_cli('encrypt-file', CMD_TARGET, '-a') { |i| i.puts "n" }.should be_success
|
23
|
+
stdout.should match /Overwrite the config file/
|
24
|
+
File.exists?("#{CMD_TARGET}.enc").should be true
|
25
|
+
end
|
20
26
|
end
|
data/spec/cli/encrypt_spec.rb
CHANGED
@@ -43,7 +43,25 @@ describe Travis::CLI::Encrypt do
|
|
43
43
|
|
44
44
|
example "travis encrypt FOO bar -a" do
|
45
45
|
described_class.any_instance.stub(:save_travis_config)
|
46
|
-
run_cli("encrypt", "FOO", "bar", "-a").should be_success
|
46
|
+
run_cli("encrypt", "FOO", "bar", "-a") { |i| i.puts "foo" }.should be_success
|
47
47
|
stderr.should match(/Environment variables in env\.global should be formatted as FOO=bar/)
|
48
48
|
end
|
49
|
+
|
50
|
+
example "travis encrypt FOO bar -a foo" do
|
51
|
+
described_class.any_instance.stub(:save_travis_config)
|
52
|
+
run_cli("encrypt", "FOO", "bar", "-a", "foo") { |i| i.puts "foo" }.should be_success
|
53
|
+
stdout.should match(/Overwrite the config file/)
|
54
|
+
end
|
55
|
+
|
56
|
+
example "travis encrypt FOO bar -a --no-interactive" do
|
57
|
+
described_class.any_instance.stub(:save_travis_config)
|
58
|
+
run_cli("encrypt", "FOO", "bar", "-a", "--no-interactive").should be_success
|
59
|
+
stderr.should match(/Environment variables in env\.global should be formatted as FOO=bar/)
|
60
|
+
end
|
61
|
+
|
62
|
+
example "travis encrypt FOO bar -a foo --no-interactive" do
|
63
|
+
described_class.any_instance.stub(:save_travis_config)
|
64
|
+
run_cli("encrypt", "FOO", "bar", "-a", "foo", "--no-interactive").should be_success
|
65
|
+
stdout.should be_empty
|
66
|
+
end
|
49
67
|
end
|
data/travis.gemspec
CHANGED
@@ -36,14 +36,12 @@ Gem::Specification.new do |s|
|
|
36
36
|
"Joep van Delft",
|
37
37
|
"Stefan Nordhausen",
|
38
38
|
"Tobias Bieniek",
|
39
|
-
"Basarat Ali Syed",
|
40
39
|
"Dominic Jodoin",
|
41
40
|
"Harald Nordgren",
|
42
41
|
"HaraldNordgren",
|
43
42
|
"Igor",
|
44
43
|
"Jacob Atzen",
|
45
44
|
"James Nylen",
|
46
|
-
"Joe Rafaniello",
|
47
45
|
"Jonas Chromik",
|
48
46
|
"Matteo Sumberaz",
|
49
47
|
"Michael S. Fischer",
|
@@ -80,14 +78,12 @@ Gem::Specification.new do |s|
|
|
80
78
|
"igor@travis-ci.org",
|
81
79
|
"stefan.nordhausen@immobilienscout24.de",
|
82
80
|
"tobias.bieniek@gmail.com",
|
83
|
-
"basaratali@gmail.com",
|
84
81
|
"dominic@travis-ci.com",
|
85
82
|
"haraldnordgren@gmail.com",
|
86
83
|
"haraldnordgren@gmail.com",
|
87
84
|
"igorwwwwwwwwwwwwwwwwwwww@users.noreply.github.com",
|
88
85
|
"jatzen@gmail.com",
|
89
86
|
"jnylen@gmail.com",
|
90
|
-
"jrafanie@users.noreply.github.com",
|
91
87
|
"joep@travis-ci.org",
|
92
88
|
"joepvd@users.noreply.github.com",
|
93
89
|
"Jonas.Chromik@student.hpi.uni-potsdam.de",
|
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.8.12.travis.
|
4
|
+
version: 1.8.12.travis.1135.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiro Asari
|
@@ -29,14 +29,12 @@ authors:
|
|
29
29
|
- Joep van Delft
|
30
30
|
- Stefan Nordhausen
|
31
31
|
- Tobias Bieniek
|
32
|
-
- Basarat Ali Syed
|
33
32
|
- Dominic Jodoin
|
34
33
|
- Harald Nordgren
|
35
34
|
- HaraldNordgren
|
36
35
|
- Igor
|
37
36
|
- Jacob Atzen
|
38
37
|
- James Nylen
|
39
|
-
- Joe Rafaniello
|
40
38
|
- Jonas Chromik
|
41
39
|
- Matteo Sumberaz
|
42
40
|
- Michael S. Fischer
|
@@ -47,7 +45,7 @@ authors:
|
|
47
45
|
autorequire:
|
48
46
|
bindir: bin
|
49
47
|
cert_chain: []
|
50
|
-
date: 2020-03-
|
48
|
+
date: 2020-03-23 00:00:00.000000000 Z
|
51
49
|
dependencies:
|
52
50
|
- !ruby/object:Gem::Dependency
|
53
51
|
name: faraday
|
@@ -256,14 +254,12 @@ email:
|
|
256
254
|
- igor@travis-ci.org
|
257
255
|
- stefan.nordhausen@immobilienscout24.de
|
258
256
|
- tobias.bieniek@gmail.com
|
259
|
-
- basaratali@gmail.com
|
260
257
|
- dominic@travis-ci.com
|
261
258
|
- haraldnordgren@gmail.com
|
262
259
|
- haraldnordgren@gmail.com
|
263
260
|
- igorwwwwwwwwwwwwwwwwwwww@users.noreply.github.com
|
264
261
|
- jatzen@gmail.com
|
265
262
|
- jnylen@gmail.com
|
266
|
-
- jrafanie@users.noreply.github.com
|
267
263
|
- joep@travis-ci.org
|
268
264
|
- joepvd@users.noreply.github.com
|
269
265
|
- Jonas.Chromik@student.hpi.uni-potsdam.de
|