eventhub-command 0.7.3 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +33 -0
- data/README.md +1 -2
- data/lib/deployer.rb +9 -9
- data/lib/deployer/base_deployer.rb +19 -25
- data/lib/deployer/config_deployer.rb +2 -2
- data/lib/deployer/console_deployer.rb +1 -2
- data/lib/deployer/executor.rb +10 -14
- data/lib/deployer/go_deployer.rb +22 -24
- data/lib/deployer/mule_deployer.rb +10 -11
- data/lib/deployer/net_ssh_extension.rb +3 -4
- data/lib/deployer/ruby_deployer.rb +20 -22
- data/lib/deployer/stage.rb +2 -2
- data/lib/eh-commands.rb +10 -10
- data/lib/eh.rb +8 -8
- data/lib/eh/commands/database.rb +11 -13
- data/lib/eh/commands/deploy.rb +25 -38
- data/lib/eh/commands/dump.rb +10 -14
- data/lib/eh/commands/generate.rb +9 -10
- data/lib/eh/commands/package.rb +26 -29
- data/lib/eh/commands/proxy.rb +12 -13
- data/lib/eh/commands/repository.rb +25 -28
- data/lib/eh/commands/stage.rb +8 -8
- data/lib/eh/proxy/proxy.rb +13 -13
- data/lib/eh/proxy/settings/git.rb +0 -1
- data/lib/eh/proxy/settings/shell.rb +1 -3
- data/lib/eh/proxy/settings/svn.rb +11 -16
- data/lib/eh/settings.rb +39 -43
- data/lib/eh/version.rb +1 -1
- data/lib/helper.rb +3 -3
- data/lib/packager.rb +3 -3
- data/lib/packager/go.rb +9 -11
- data/lib/packager/rails.rb +4 -5
- data/lib/packager/ruby.rb +7 -8
- metadata +47 -20
data/lib/eh/commands/generate.rb
CHANGED
@@ -1,17 +1,16 @@
|
|
1
|
-
desc
|
1
|
+
desc "Generate template for a new processor"
|
2
2
|
command :generate do |c|
|
3
|
-
|
4
|
-
c.arg_name 'MODULE_NAME PROCESSOR_NAME'
|
3
|
+
c.arg_name "MODULE_NAME PROCESSOR_NAME"
|
5
4
|
c.desc "Generate ruby based processor"
|
6
5
|
c.command :ruby do |c|
|
7
6
|
c.action do |global_options, options, args|
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
7
|
+
require "active_support/core_ext/string/inflections"
|
8
|
+
require "fileutils"
|
9
|
+
require "erb"
|
11
10
|
|
12
11
|
if args.size != 2
|
13
12
|
puts "Needs exactly 2 arguments: eh generate processor MODULE NAME"
|
14
|
-
exit
|
13
|
+
exit(-1)
|
15
14
|
end
|
16
15
|
|
17
16
|
processor_module_name = args[0].camelcase
|
@@ -22,9 +21,9 @@ command :generate do |c|
|
|
22
21
|
destination_dir = Eh::Settings.current.ruby_processors_src_dir
|
23
22
|
destination_dir = File.join(destination_dir, "#{underscored_processor_module_name}.#{underscored_processor_class_name}")
|
24
23
|
|
25
|
-
if Dir.
|
24
|
+
if Dir.exist? destination_dir
|
26
25
|
puts "#{destination_dir} already exists!"
|
27
|
-
exit
|
26
|
+
exit(-1)
|
28
27
|
end
|
29
28
|
|
30
29
|
template_tmp_dir = Eh::Settings.current.template_tmp_dir
|
@@ -32,7 +31,7 @@ command :generate do |c|
|
|
32
31
|
|
33
32
|
FileUtils.cp_r template_tmp_dir, destination_dir
|
34
33
|
FileUtils.rm_rf File.join(destination_dir, ".git")
|
35
|
-
FileUtils.rm File.join(destination_dir,
|
34
|
+
FileUtils.rm File.join(destination_dir, "README.md")
|
36
35
|
|
37
36
|
puts "Generating processor #{processor_module_name}::#{processor_class_name} in #{destination_dir}"
|
38
37
|
Dir.glob(destination_dir + "/**/*.erb") do |file|
|
data/lib/eh/commands/package.rb
CHANGED
@@ -1,58 +1,55 @@
|
|
1
|
-
desc
|
1
|
+
desc "Package commands"
|
2
2
|
command :package do |package|
|
3
|
-
package.flag([:s, :source], :
|
4
|
-
package.flag([:d, :destination], :
|
5
|
-
package.flag([:x, :exclude], arg_name:
|
3
|
+
package.flag([:s, :source], desc: "Source directory to read processors from.")
|
4
|
+
package.flag([:d, :destination], desc: "Destination directory to place created zip files.")
|
5
|
+
package.flag([:x, :exclude], arg_name: "NAME1,NAME2,PATTERN*", desc: "Exclude components with NAME1,NAME2,PATTERN*", type: String)
|
6
6
|
|
7
|
-
package.desc
|
8
|
-
package.arg_name
|
7
|
+
package.desc "Packages ruby processors to zip files"
|
8
|
+
package.arg_name "[NAME1,[NAME2,PATTERN*]]"
|
9
9
|
package.command :ruby do |ruby|
|
10
|
-
|
11
10
|
ruby.action do |global_options, options, args|
|
12
|
-
options[
|
13
|
-
options[
|
14
|
-
source_dir = options.fetch(
|
15
|
-
destination_dir = options.fetch(
|
11
|
+
options["s"] ||= Eh::Settings.current.ruby_processors_src_dir
|
12
|
+
options["d"] ||= Eh::Settings.current.ruby_release_dir
|
13
|
+
source_dir = options.fetch("s")
|
14
|
+
destination_dir = options.fetch("d")
|
16
15
|
include_pattern = args[0]
|
17
|
-
exclude_pattern = options[
|
16
|
+
exclude_pattern = options["x"]
|
18
17
|
packager = Packager::Ruby.new(source_dir, destination_dir, include_pattern, exclude_pattern)
|
19
18
|
packager.package
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
23
|
-
package.desc
|
24
|
-
package.arg_name
|
22
|
+
package.desc "Packages go processors to zip files"
|
23
|
+
package.arg_name "[NAME1,[NAME2,PATTERN*]]"
|
25
24
|
package.command :go do |go|
|
26
|
-
go.flag([:p, :platform], arg_name:
|
25
|
+
go.flag([:p, :platform], arg_name: "PLATFORM", desc: "Target platform", must_match: ["linux", "darwin", "windows"], default_value: "linux")
|
27
26
|
|
28
27
|
go.action do |global_options, options, args|
|
29
|
-
options[
|
30
|
-
options[
|
31
|
-
source_dir = options.fetch(
|
32
|
-
destination_dir = options.fetch(
|
28
|
+
options["s"] ||= Eh::Settings.current.go_processors_src_dir
|
29
|
+
options["d"] ||= Eh::Settings.current.go_release_dir
|
30
|
+
source_dir = options.fetch("s")
|
31
|
+
destination_dir = options.fetch("d")
|
33
32
|
include_pattern = args[0]
|
34
|
-
exclude_pattern = options[
|
35
|
-
platform = options[
|
33
|
+
exclude_pattern = options["x"]
|
34
|
+
platform = options["p"] || "linux"
|
36
35
|
packager = Packager::Go.new(source_dir, destination_dir, include_pattern, exclude_pattern, platform)
|
37
36
|
packager.package
|
38
37
|
end
|
39
|
-
|
40
38
|
end
|
41
39
|
|
42
|
-
package.desc
|
40
|
+
package.desc "Packages rails console app to zip file"
|
43
41
|
package.command :rails do |rails|
|
44
42
|
rails.action do |global_options, options, args|
|
45
|
-
options[
|
46
|
-
options[
|
43
|
+
options["s"] ||= Eh::Settings.current.rails_src_dir
|
44
|
+
options["d"] ||= Eh::Settings.current.rails_release_dir
|
47
45
|
|
48
|
-
raise
|
46
|
+
raise "Flag [-x, --exclude] is currently not supported with rails subcommand" if options[:exclude]
|
49
47
|
|
50
|
-
source_dir = options.fetch(
|
51
|
-
destination_dir = options.fetch(
|
48
|
+
source_dir = options.fetch("s")
|
49
|
+
destination_dir = options.fetch("d")
|
52
50
|
|
53
51
|
packager = Packager::Rails.new(source_dir, destination_dir)
|
54
52
|
packager.package
|
55
53
|
end
|
56
54
|
end
|
57
|
-
|
58
55
|
end
|
data/lib/eh/commands/proxy.rb
CHANGED
@@ -1,41 +1,40 @@
|
|
1
|
-
desc
|
1
|
+
desc "Manage proxies"
|
2
2
|
command :proxy do |proxy|
|
3
|
+
proxy.switch([:v, :verbose], desc: "Show additional output.")
|
4
|
+
proxy.flag([:stage], desc: "stage", type: String, long_desc: "Stage where proxy is", default_value: Eh::Settings.current.default_stage)
|
3
5
|
|
4
|
-
proxy.
|
5
|
-
proxy.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where proxy is', default_value: Eh::Settings.current.default_stage)
|
6
|
-
|
7
|
-
proxy.desc 'List defined proxies'
|
6
|
+
proxy.desc "List defined proxies"
|
8
7
|
proxy.command :list do |list|
|
9
8
|
list.action do |global_options, options, arguments|
|
10
9
|
Eh::Proxy::Proxy.new(options[:stage], options[:verbose]).list
|
11
10
|
end
|
12
11
|
end
|
13
12
|
|
14
|
-
proxy.desc
|
15
|
-
proxy.arg_name
|
13
|
+
proxy.desc "Select proxy by NAME"
|
14
|
+
proxy.arg_name "NAME"
|
16
15
|
proxy.command :select do |select|
|
17
16
|
select.action do |global_options, options, arguments|
|
18
17
|
Eh::Proxy::Proxy.new(options[:stage], options[:verbose]).select(arguments[0])
|
19
18
|
end
|
20
19
|
end
|
21
20
|
|
22
|
-
proxy.desc
|
23
|
-
proxy.arg_name
|
21
|
+
proxy.desc "Enable proxy default or by NAME"
|
22
|
+
proxy.arg_name "NAME"
|
24
23
|
proxy.command :on do |on|
|
25
24
|
on.action do |global_options, options, arguments|
|
26
25
|
Eh::Proxy::Proxy.new(options[:stage], options[:verbose]).set(arguments[0])
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
30
|
-
proxy.desc
|
29
|
+
proxy.desc "Disable default proxy"
|
31
30
|
proxy.command :off do |off|
|
32
31
|
off.action do |global_options, options, arguments|
|
33
32
|
Eh::Proxy::Proxy.new(options[:stage], options[:verbose]).unset
|
34
33
|
end
|
35
34
|
end
|
36
35
|
|
37
|
-
proxy.desc
|
38
|
-
proxy.arg_name
|
36
|
+
proxy.desc "Add new proxy by NAME and PROXY_URL"
|
37
|
+
proxy.arg_name "NAME PROXY_URL"
|
39
38
|
proxy.command :add do |add|
|
40
39
|
add.action do |global, options, arguments|
|
41
40
|
Eh::Proxy::Proxy.new(options[:stage], options[:verbose]).add(arguments[0], arguments[1])
|
@@ -43,7 +42,7 @@ command :proxy do |proxy|
|
|
43
42
|
end
|
44
43
|
|
45
44
|
proxy.desc "Remove by NAME"
|
46
|
-
proxy.arg_name
|
45
|
+
proxy.arg_name "NAME"
|
47
46
|
proxy.command :remove do |remove|
|
48
47
|
remove.action do |global_options, options, arguments|
|
49
48
|
Eh::Proxy::Proxy.new(options[:stage], options[:verbose]).remove(arguments[0])
|
@@ -3,23 +3,22 @@ desc "Manage repositories"
|
|
3
3
|
command :repository do |command|
|
4
4
|
command.desc "Lists all avaiable repositories"
|
5
5
|
command.command :list do |command|
|
6
|
-
command.action do |global_options,options,args|
|
7
|
-
|
8
|
-
puts "Defined Repositories [#{Eh::Settings.current.data['repositories'].size}]"
|
6
|
+
command.action do |global_options, options, args|
|
7
|
+
puts "Defined Repositories [#{Eh::Settings.current.data["repositories"].size}]"
|
9
8
|
Eh::Settings.current.repositories.each_with_index do |repository, index|
|
10
9
|
if repository.current?
|
11
|
-
puts " #{index+1}. #{repository.url} (current)".green
|
10
|
+
puts " #{index + 1}. #{repository.url} (current)".green
|
12
11
|
else
|
13
|
-
puts " #{index+1}. #{repository.url}"
|
12
|
+
puts " #{index + 1}. #{repository.url}"
|
14
13
|
end
|
15
14
|
end
|
16
15
|
end
|
17
16
|
end
|
18
17
|
|
19
18
|
command.desc "Selects a repository by INDEX"
|
20
|
-
command.arg_name
|
19
|
+
command.arg_name "INDEX"
|
21
20
|
command.command :select do |command|
|
22
|
-
command.action do |global_options,options,args|
|
21
|
+
command.action do |global_options, options, args|
|
23
22
|
if Eh::Settings.current.repositories.length == 0
|
24
23
|
raise "No repository configured so far"
|
25
24
|
end
|
@@ -27,53 +26,51 @@ command :repository do |command|
|
|
27
26
|
raise "Needs mandatory INDEX argument"
|
28
27
|
end
|
29
28
|
selected = args[0].to_i
|
30
|
-
if selected > Eh::Settings.current.data[
|
29
|
+
if selected > Eh::Settings.current.data["repositories"].size
|
31
30
|
raise "Argument INDEX is out of range"
|
32
31
|
end
|
33
|
-
Eh::Settings.current.data[
|
34
|
-
repository[
|
32
|
+
Eh::Settings.current.data["repositories"].each_with_index do |repository, index|
|
33
|
+
repository["current"] = (index + 1) == selected
|
35
34
|
end
|
36
35
|
Eh::Settings.current.write
|
37
36
|
puts "Repository selected: #{Eh::Settings.current.repository.url}".green
|
38
37
|
end
|
39
38
|
end
|
40
39
|
|
41
|
-
command.desc
|
42
|
-
command.arg_name
|
40
|
+
command.desc "Add a repository with URL DIR USERNAME PASSWORD"
|
41
|
+
command.arg_name "URL DIR USERNAME PASSWORD"
|
43
42
|
command.command :add do |command|
|
44
43
|
command.action do |global_options, options, args|
|
45
44
|
if args.length != 4
|
46
45
|
raise "Need exactly 4 arguments: URL, DIR, USERNAME, PASSWORD"
|
47
46
|
end
|
48
|
-
Eh::Settings.current.data[
|
47
|
+
Eh::Settings.current.data["repositories"] ||= []
|
49
48
|
|
50
49
|
# check if same repo already exists
|
51
|
-
exists = Eh::Settings.current.data[
|
52
|
-
repository[
|
50
|
+
exists = Eh::Settings.current.data["repositories"].any? do |repository|
|
51
|
+
repository["url"] == args[0]
|
53
52
|
end
|
54
53
|
if exists
|
55
54
|
raise "Already configured repository [#{args[0]}]"
|
56
55
|
end
|
57
56
|
|
58
|
-
Eh::Settings.current.data[
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
57
|
+
Eh::Settings.current.data["repositories"] << {
|
58
|
+
"url" => args[0],
|
59
|
+
"dir" => File::ALT_SEPARATOR ? args[1].gsub(File::ALT_SEPARATOR, File::SEPARATOR) : args[1],
|
60
|
+
"deploy_username" => args[2],
|
61
|
+
"deploy_password" => args[3],
|
62
|
+
"current" => (Eh::Settings.current.data["repositories"].length == 0)
|
64
63
|
}
|
65
64
|
Eh::Settings.current.write
|
66
65
|
|
67
|
-
puts "New Repository [#{args[0]}] has beed added. Total Repositories: #{Eh::Settings.current.data[
|
66
|
+
puts "New Repository [#{args[0]}] has beed added. Total Repositories: #{Eh::Settings.current.data["repositories"].size}".green
|
68
67
|
end
|
69
68
|
end
|
70
69
|
|
71
|
-
|
72
|
-
command.
|
73
|
-
command.arg_name 'INDEX'
|
70
|
+
command.desc "Remove a repository by INDEX"
|
71
|
+
command.arg_name "INDEX"
|
74
72
|
command.command :remove do |command|
|
75
73
|
command.action do |global_options, options, args|
|
76
|
-
|
77
74
|
if args.length != 1
|
78
75
|
raise "Needs mandatory INDEX argument"
|
79
76
|
end
|
@@ -83,10 +80,10 @@ command :repository do |command|
|
|
83
80
|
raise "No repository with index [selected]"
|
84
81
|
end
|
85
82
|
|
86
|
-
Eh::Settings.current.data[
|
83
|
+
Eh::Settings.current.data["repositories"].delete_at(selected - 1)
|
87
84
|
Eh::Settings.current.write
|
88
85
|
|
89
|
-
puts "Repository has been removed. Total Repositories: #{Eh::Settings.current.data[
|
86
|
+
puts "Repository has been removed. Total Repositories: #{Eh::Settings.current.data["repositories"].size}".green
|
90
87
|
end
|
91
88
|
end
|
92
89
|
|
data/lib/eh/commands/stage.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
desc
|
1
|
+
desc "Manage stages"
|
2
2
|
command :stage do |command|
|
3
|
-
command.desc
|
3
|
+
command.desc "List defined stages"
|
4
4
|
command.command :list do |list|
|
5
5
|
list.action do |global_options, options, args|
|
6
6
|
dir = Eh::Settings.current.stages_dir
|
7
7
|
puts "Checking in #{dir}".yellow if global_options[:verbose]
|
8
8
|
puts "Available Stages"
|
9
|
-
Dir.glob(File.join(dir,
|
10
|
-
stage_name = File.basename(name,
|
9
|
+
Dir.glob(File.join(dir, "*.yml")) do |name|
|
10
|
+
stage_name = File.basename(name, ".*")
|
11
11
|
is_default = Eh::Settings.current.default_stage == stage_name
|
12
|
-
puts " - #{stage_name} #{is_default ?
|
12
|
+
puts " - #{stage_name} #{is_default ? "(default)" : nil}".send(is_default ? :green : :white)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
command.desc
|
18
|
-
command.arg_name
|
17
|
+
command.desc "Select default stage"
|
18
|
+
command.arg_name "NAME"
|
19
19
|
command.command :select do |default|
|
20
20
|
default.action do |global_options, options, args|
|
21
21
|
new_stage = args[0]
|
@@ -29,7 +29,7 @@ command :stage do |command|
|
|
29
29
|
raise "Stage [#{new_stage}] is not defined yet"
|
30
30
|
end
|
31
31
|
|
32
|
-
Eh::Settings.current.data[
|
32
|
+
Eh::Settings.current.data["default_stage"] = new_stage
|
33
33
|
Eh::Settings.current.write
|
34
34
|
puts "Default stage selected: #{new_stage}".green
|
35
35
|
end
|
data/lib/eh/proxy/proxy.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Eh
|
2
2
|
module Proxy
|
3
|
-
require
|
4
|
-
require_relative
|
5
|
-
require_relative
|
6
|
-
require_relative
|
3
|
+
require "uri"
|
4
|
+
require_relative "settings/git"
|
5
|
+
require_relative "settings/svn"
|
6
|
+
require_relative "settings/shell"
|
7
7
|
|
8
8
|
class Proxy
|
9
9
|
def initialize(stage_name, verbose)
|
@@ -34,7 +34,7 @@ module Eh
|
|
34
34
|
raise "No proxy with given name [#{name}]"
|
35
35
|
end
|
36
36
|
|
37
|
-
Eh::Settings.current.data[
|
37
|
+
Eh::Settings.current.data["proxies"].reject! { |json| json["name"] == name }
|
38
38
|
Eh::Settings.current.write
|
39
39
|
puts "Proxy [#{name}] has been removed".green
|
40
40
|
end
|
@@ -47,10 +47,10 @@ module Eh
|
|
47
47
|
raise "Already configured proxy for [#{name} -> #{url}]"
|
48
48
|
end
|
49
49
|
|
50
|
-
Eh::Settings.current.data[
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
Eh::Settings.current.data["proxies"] << {
|
51
|
+
"url" => url,
|
52
|
+
"name" => name,
|
53
|
+
"default" => (Eh::Settings.current.proxies.length == 0)
|
54
54
|
}
|
55
55
|
Eh::Settings.current.write
|
56
56
|
puts "Proxy [#{name}] has been added".green
|
@@ -63,8 +63,8 @@ module Eh
|
|
63
63
|
raise "No proxy found with given name [#{name}]"
|
64
64
|
end
|
65
65
|
|
66
|
-
Eh::Settings.current.data[
|
67
|
-
json[
|
66
|
+
Eh::Settings.current.data["proxies"].each do |json|
|
67
|
+
json["default"] = (json["name"] == name)
|
68
68
|
end
|
69
69
|
Eh::Settings.current.write
|
70
70
|
puts "Proxy [#{name}] has been selected".green
|
@@ -73,11 +73,12 @@ module Eh
|
|
73
73
|
def list
|
74
74
|
puts "Defined Proxies"
|
75
75
|
Eh::Settings.current.proxies.each do |proxy|
|
76
|
-
puts proxy.label.send(
|
76
|
+
puts proxy.label.send(/\(default\)/.match?(proxy.label) ? :green : :white)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
80
|
private
|
81
|
+
|
81
82
|
attr_reader :stage_name, :verbose
|
82
83
|
|
83
84
|
def stage
|
@@ -99,7 +100,6 @@ module Eh
|
|
99
100
|
def find_default_proxy
|
100
101
|
Eh::Settings.current.proxies.find { |proxy| proxy.default }
|
101
102
|
end
|
102
|
-
|
103
103
|
end
|
104
104
|
end
|
105
105
|
end
|
@@ -8,7 +8,6 @@ module Eh::Proxy::Settings
|
|
8
8
|
def set(value)
|
9
9
|
Deployer::Executor.new(stage, verbose: verbose?) do |executor|
|
10
10
|
executor.execute(set_command(value), abort_on_error: false)
|
11
|
-
|
12
11
|
end
|
13
12
|
end
|
14
13
|
|
@@ -18,11 +17,10 @@ module Eh::Proxy::Settings
|
|
18
17
|
end
|
19
18
|
end
|
20
19
|
|
21
|
-
|
22
20
|
private
|
23
21
|
|
24
22
|
def proxy_file
|
25
|
-
|
23
|
+
"~/.proxy"
|
26
24
|
end
|
27
25
|
|
28
26
|
def verbose?
|
@@ -1,7 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "tempfile"
|
2
|
+
require "parseconfig"
|
3
3
|
module Eh::Proxy::Settings
|
4
|
-
|
5
4
|
class Svn
|
6
5
|
def initialize(stage, verbose = true)
|
7
6
|
@stage = stage
|
@@ -13,16 +12,15 @@ module Eh::Proxy::Settings
|
|
13
12
|
executor.download("~/.subversion/servers", temporary_config_file)
|
14
13
|
config = ParseConfig.new(temporary_config_file)
|
15
14
|
|
16
|
-
config[
|
17
|
-
config[
|
18
|
-
config[
|
19
|
-
config[
|
20
|
-
File.open(temporary_config_file,
|
15
|
+
config["global"].delete("http-proxy-host")
|
16
|
+
config["global"].delete("http-proxy-port")
|
17
|
+
config["global"].delete("http-proxy-username")
|
18
|
+
config["global"].delete("http-proxy-password")
|
19
|
+
File.open(temporary_config_file, "w") do |file|
|
21
20
|
config.write(file, false)
|
22
21
|
end
|
23
22
|
executor.upload(temporary_config_file, "~/.subversion/servers")
|
24
23
|
end
|
25
|
-
|
26
24
|
end
|
27
25
|
|
28
26
|
def set(value)
|
@@ -31,14 +29,13 @@ module Eh::Proxy::Settings
|
|
31
29
|
Deployer::Executor.new(stage, verbose: verbose?) do |executor|
|
32
30
|
executor.download("~/.subversion/servers", temporary_config_file)
|
33
31
|
config = ParseConfig.new(temporary_config_file)
|
34
|
-
config[
|
35
|
-
config[
|
36
|
-
File.open(temporary_config_file,
|
32
|
+
config["global"]["http-proxy-host"] = uri.host
|
33
|
+
config["global"]["http-proxy-port"] = uri.port
|
34
|
+
File.open(temporary_config_file, "w") do |file|
|
37
35
|
config.write(file, false)
|
38
36
|
end
|
39
37
|
executor.upload(temporary_config_file, "~/.subversion/servers")
|
40
38
|
end
|
41
|
-
|
42
39
|
end
|
43
40
|
|
44
41
|
private
|
@@ -50,12 +47,10 @@ module Eh::Proxy::Settings
|
|
50
47
|
attr_reader :stage
|
51
48
|
|
52
49
|
def unset_command
|
53
|
-
|
54
50
|
end
|
55
51
|
|
56
52
|
def temporary_config_file
|
57
|
-
@temporary_config_file ||= Dir::Tmpname.make_tmpname([Dir.tmpdir,
|
53
|
+
@temporary_config_file ||= Dir::Tmpname.make_tmpname([Dir.tmpdir, "subversion_servers"], nil)
|
58
54
|
end
|
59
|
-
|
60
55
|
end
|
61
56
|
end
|