eventhub-command 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +17 -17
- data/Gemfile +2 -2
- data/README.md +91 -91
- data/Rakefile +44 -44
- data/bin/eh +35 -35
- data/eh.gemspec +29 -29
- data/eh.rdoc +4 -4
- data/lib/deployer/base_deployer.rb +149 -149
- data/lib/deployer/executor.rb +113 -113
- data/lib/deployer/mule_deployer.rb +85 -85
- data/lib/deployer/net_ssh_extension.rb +45 -45
- data/lib/deployer/ruby_deployer.rb +114 -111
- data/lib/deployer/stage.rb +36 -36
- data/lib/deployer.rb +12 -12
- data/lib/eh/commands/deploy_mule.rb +23 -23
- data/lib/eh/commands/deploy_ruby.rb +25 -25
- data/lib/eh/commands/generate_processor.rb +90 -90
- data/lib/eh/commands/package_ruby.rb +113 -113
- data/lib/eh/commands/repository.rb +81 -81
- data/lib/eh/settings.rb +131 -131
- data/lib/eh/version.rb +3 -3
- data/lib/eh-commands.rb +21 -21
- data/lib/eh.rb +11 -11
- data/test/default_test.rb +14 -14
- data/test/test_helper.rb +9 -9
- data/todo.txt +8 -8
- metadata +3 -4
@@ -1,85 +1,85 @@
|
|
1
|
-
class Deployer::MuleDeployer < Deployer::BaseDeployer
|
2
|
-
attr_reader :adapter_names
|
3
|
-
|
4
|
-
def initialize(adapter_names, options)
|
5
|
-
super(options)
|
6
|
-
@adapter_names = adapter_names
|
7
|
-
end
|
8
|
-
|
9
|
-
def adapter_cached_copy(adapter_name)
|
10
|
-
cached_copy_dir('mule', "#{adapter_name}.zip")
|
11
|
-
end
|
12
|
-
|
13
|
-
def config_source_dir(adapter_name)
|
14
|
-
super('mule', adapter_name)
|
15
|
-
end
|
16
|
-
|
17
|
-
def deploy!
|
18
|
-
puts "deploying to #{stage.name} via #{deploy_via}".light_blue.on_blue
|
19
|
-
|
20
|
-
Deployer::Executor.new(stage, verbose: verbose?) do |executor|
|
21
|
-
create_base_dirs(executor)
|
22
|
-
|
23
|
-
# update
|
24
|
-
update_cached_copy(executor)
|
25
|
-
|
26
|
-
adapter_names_to_deploy = resolve_adapter_names(executor, options)
|
27
|
-
|
28
|
-
adapter_names_to_deploy.each do |adapter_name|
|
29
|
-
puts
|
30
|
-
puts "Deploying #{adapter_name}".light_blue.on_blue
|
31
|
-
log_deployment(executor, "Deploying #{adapter_name} via #{deploy_via} from #{cached_copy_dir}")
|
32
|
-
# make a copy of the zip files to merge them with config
|
33
|
-
cached_copy_source = adapter_cached_copy(adapter_name)
|
34
|
-
configuration_target = File.join(base_dir, 'mule', "#{adapter_name}.zip")
|
35
|
-
executor.execute("cp #{cached_copy_source} #{configuration_target}")
|
36
|
-
|
37
|
-
# copy config
|
38
|
-
config_source = config_source_dir(adapter_name)
|
39
|
-
executor.execute("if [[ -d #{config_source} ]] ; then cd #{config_source} ; zip -r #{configuration_target} . ; fi")
|
40
|
-
|
41
|
-
# deploy
|
42
|
-
executor.execute("cp #{configuration_target} $MULE_HOME/apps")
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
def resolve_adapter_names(executor, options)
|
51
|
-
available = remote_ls(executor, options, cached_copy_dir('mule', '*.zip')).map do |name|
|
52
|
-
File.basename(name, '.zip')
|
53
|
-
end
|
54
|
-
|
55
|
-
fetched = Array(adapter_names).map do |name|
|
56
|
-
if name.include?('*') # resolve pattern on remote machine
|
57
|
-
remote_ls(executor, options, cached_copy_dir('mule', "#{name}.zip"))
|
58
|
-
else
|
59
|
-
name
|
60
|
-
end
|
61
|
-
end
|
62
|
-
if fetched.empty? # then fetch all
|
63
|
-
fetched = available
|
64
|
-
end
|
65
|
-
|
66
|
-
fetched = fetched.flatten.map do |name|
|
67
|
-
File.basename(name, '.zip')
|
68
|
-
end
|
69
|
-
|
70
|
-
verify_deployment_list!(fetched, available)
|
71
|
-
|
72
|
-
fetched
|
73
|
-
end
|
74
|
-
|
75
|
-
def update_cached_copy(executor)
|
76
|
-
if via_scp?
|
77
|
-
source = Eh::Settings.current.releases_dir('mule', '*.zip')
|
78
|
-
target_dir = cached_copy_dir('mule')
|
79
|
-
executor.execute("rm -rf #{target_dir}/*.zip && mkdir -p #{target_dir}")
|
80
|
-
executor.upload(source, target_dir)
|
81
|
-
else
|
82
|
-
update_scm(executor)
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
1
|
+
class Deployer::MuleDeployer < Deployer::BaseDeployer
|
2
|
+
attr_reader :adapter_names
|
3
|
+
|
4
|
+
def initialize(adapter_names, options)
|
5
|
+
super(options)
|
6
|
+
@adapter_names = adapter_names
|
7
|
+
end
|
8
|
+
|
9
|
+
def adapter_cached_copy(adapter_name)
|
10
|
+
cached_copy_dir('mule', "#{adapter_name}.zip")
|
11
|
+
end
|
12
|
+
|
13
|
+
def config_source_dir(adapter_name)
|
14
|
+
super('mule', adapter_name)
|
15
|
+
end
|
16
|
+
|
17
|
+
def deploy!
|
18
|
+
puts "deploying to #{stage.name} via #{deploy_via}".light_blue.on_blue
|
19
|
+
|
20
|
+
Deployer::Executor.new(stage, verbose: verbose?) do |executor|
|
21
|
+
create_base_dirs(executor)
|
22
|
+
|
23
|
+
# update
|
24
|
+
update_cached_copy(executor)
|
25
|
+
|
26
|
+
adapter_names_to_deploy = resolve_adapter_names(executor, options)
|
27
|
+
|
28
|
+
adapter_names_to_deploy.each do |adapter_name|
|
29
|
+
puts
|
30
|
+
puts "Deploying #{adapter_name}".light_blue.on_blue
|
31
|
+
log_deployment(executor, "Deploying #{adapter_name} via #{deploy_via} from #{cached_copy_dir}")
|
32
|
+
# make a copy of the zip files to merge them with config
|
33
|
+
cached_copy_source = adapter_cached_copy(adapter_name)
|
34
|
+
configuration_target = File.join(base_dir, 'mule', "#{adapter_name}.zip")
|
35
|
+
executor.execute("cp #{cached_copy_source} #{configuration_target}")
|
36
|
+
|
37
|
+
# copy config
|
38
|
+
config_source = config_source_dir(adapter_name)
|
39
|
+
executor.execute("if [[ -d #{config_source} ]] ; then cd #{config_source} ; zip -r #{configuration_target} . ; fi")
|
40
|
+
|
41
|
+
# deploy
|
42
|
+
executor.execute("cp #{configuration_target} $MULE_HOME/apps")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def resolve_adapter_names(executor, options)
|
51
|
+
available = remote_ls(executor, options, cached_copy_dir('mule', '*.zip')).map do |name|
|
52
|
+
File.basename(name, '.zip')
|
53
|
+
end
|
54
|
+
|
55
|
+
fetched = Array(adapter_names).map do |name|
|
56
|
+
if name.include?('*') # resolve pattern on remote machine
|
57
|
+
remote_ls(executor, options, cached_copy_dir('mule', "#{name}.zip"))
|
58
|
+
else
|
59
|
+
name
|
60
|
+
end
|
61
|
+
end
|
62
|
+
if fetched.empty? # then fetch all
|
63
|
+
fetched = available
|
64
|
+
end
|
65
|
+
|
66
|
+
fetched = fetched.flatten.map do |name|
|
67
|
+
File.basename(name, '.zip')
|
68
|
+
end
|
69
|
+
|
70
|
+
verify_deployment_list!(fetched, available)
|
71
|
+
|
72
|
+
fetched
|
73
|
+
end
|
74
|
+
|
75
|
+
def update_cached_copy(executor)
|
76
|
+
if via_scp?
|
77
|
+
source = Eh::Settings.current.releases_dir('mule', '*.zip')
|
78
|
+
target_dir = cached_copy_dir('mule')
|
79
|
+
executor.execute("rm -rf #{target_dir}/*.zip && mkdir -p #{target_dir}")
|
80
|
+
executor.upload(source, target_dir)
|
81
|
+
else
|
82
|
+
update_scm(executor)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -1,45 +1,45 @@
|
|
1
|
-
class Net::SSH::Connection::Session
|
2
|
-
|
3
|
-
def exec_sc!(command, verbose = false)
|
4
|
-
stdout_data,stderr_data = "",""
|
5
|
-
exit_code, exit_signal = nil,nil
|
6
|
-
self.open_channel do |channel|
|
7
|
-
channel.exec(command) do |_, success|
|
8
|
-
raise "Command \"#{command}\" was unable to execute" unless success
|
9
|
-
|
10
|
-
channel.on_data do |_, data|
|
11
|
-
if verbose
|
12
|
-
puts
|
13
|
-
puts data.light_blue.on_white if verbose
|
14
|
-
end
|
15
|
-
stdout_data += data
|
16
|
-
end
|
17
|
-
|
18
|
-
channel.on_extended_data do |_, _, data|
|
19
|
-
if verbose
|
20
|
-
puts
|
21
|
-
puts data.light_blue.on_white if verbose
|
22
|
-
end
|
23
|
-
stderr_data += data
|
24
|
-
end
|
25
|
-
|
26
|
-
channel.on_request("exit-status") do |_, data|
|
27
|
-
exit_code = data.read_long
|
28
|
-
end
|
29
|
-
|
30
|
-
channel.on_request("exit-signal") do |_, data|
|
31
|
-
exit_signal = data.read_long
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
self.loop
|
36
|
-
raise stderr_data unless exit_code == 0
|
37
|
-
|
38
|
-
{
|
39
|
-
stdout: stdout_data,
|
40
|
-
stderr: stderr_data,
|
41
|
-
exit_code: exit_code,
|
42
|
-
exit_signal: exit_signal
|
43
|
-
}
|
44
|
-
end
|
45
|
-
end
|
1
|
+
class Net::SSH::Connection::Session
|
2
|
+
|
3
|
+
def exec_sc!(command, verbose = false)
|
4
|
+
stdout_data,stderr_data = "",""
|
5
|
+
exit_code, exit_signal = nil,nil
|
6
|
+
self.open_channel do |channel|
|
7
|
+
channel.exec(command) do |_, success|
|
8
|
+
raise "Command \"#{command}\" was unable to execute" unless success
|
9
|
+
|
10
|
+
channel.on_data do |_, data|
|
11
|
+
if verbose
|
12
|
+
puts
|
13
|
+
puts data.light_blue.on_white if verbose
|
14
|
+
end
|
15
|
+
stdout_data += data
|
16
|
+
end
|
17
|
+
|
18
|
+
channel.on_extended_data do |_, _, data|
|
19
|
+
if verbose
|
20
|
+
puts
|
21
|
+
puts data.light_blue.on_white if verbose
|
22
|
+
end
|
23
|
+
stderr_data += data
|
24
|
+
end
|
25
|
+
|
26
|
+
channel.on_request("exit-status") do |_, data|
|
27
|
+
exit_code = data.read_long
|
28
|
+
end
|
29
|
+
|
30
|
+
channel.on_request("exit-signal") do |_, data|
|
31
|
+
exit_signal = data.read_long
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
self.loop
|
36
|
+
raise stderr_data unless exit_code == 0
|
37
|
+
|
38
|
+
{
|
39
|
+
stdout: stdout_data,
|
40
|
+
stderr: stderr_data,
|
41
|
+
exit_code: exit_code,
|
42
|
+
exit_signal: exit_signal
|
43
|
+
}
|
44
|
+
end
|
45
|
+
end
|
@@ -1,111 +1,114 @@
|
|
1
|
-
class Deployer::RubyDeployer < Deployer::BaseDeployer
|
2
|
-
attr_accessor :processor_names
|
3
|
-
|
4
|
-
def initialize(processor_names, options)
|
5
|
-
super(options)
|
6
|
-
@processor_names = processor_names
|
7
|
-
end
|
8
|
-
|
9
|
-
def deploy!
|
10
|
-
puts "deploying to #{stage.name} via #{deploy_via}".light_blue.on_blue
|
11
|
-
|
12
|
-
Deployer::Executor.new(stage, verbose: verbose?) do |executor|
|
13
|
-
create_base_dirs(executor)
|
14
|
-
|
15
|
-
|
16
|
-
update_cached_copy(executor)
|
17
|
-
|
18
|
-
|
19
|
-
# fetch processor_names unless they have been passed as an argument to the initializer
|
20
|
-
processor_names_to_deploy = resolve_processor_names(executor, options)
|
21
|
-
processor_names_to_deploy.each do |processor_name|
|
22
|
-
puts
|
23
|
-
puts "Deploying #{processor_name}".light_blue.on_blue
|
24
|
-
log_deployment(executor, "Deploying #{processor_name} via #{deploy_via} from #{cached_copy_dir}")
|
25
|
-
# stop old one
|
26
|
-
executor.execute("kill -s TERM $(cat #{File.join(pids_dir, processor_name)}.pid)", abort_on_error: false, comment: "This is not sooo important")
|
27
|
-
|
28
|
-
# unzip package
|
29
|
-
target = deploy_dir('ruby')
|
30
|
-
source = cached_copy_dir('ruby',"#{processor_name}.zip")
|
31
|
-
executor.execute("rm -rf #{processor_dir(processor_name)} && unzip -o -d #{target} #{source}")
|
32
|
-
|
33
|
-
# copy config
|
34
|
-
executor.execute("if [[ -d #{config_source_dir(processor_name)} ]] ; then cp -r #{config_source_dir(processor_name)}/* #{processor_dir(processor_name)}; fi")
|
35
|
-
|
36
|
-
#
|
37
|
-
executor.execute("
|
38
|
-
|
39
|
-
# symlink
|
40
|
-
executor.execute("ln -s #{
|
41
|
-
|
42
|
-
#
|
43
|
-
executor.execute("
|
44
|
-
|
45
|
-
#
|
46
|
-
executor.execute("cd #{processor_dir(processor_name)} && bundle
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
end
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
1
|
+
class Deployer::RubyDeployer < Deployer::BaseDeployer
|
2
|
+
attr_accessor :processor_names
|
3
|
+
|
4
|
+
def initialize(processor_names, options)
|
5
|
+
super(options)
|
6
|
+
@processor_names = processor_names
|
7
|
+
end
|
8
|
+
|
9
|
+
def deploy!
|
10
|
+
puts "deploying to #{stage.name} via #{deploy_via}".light_blue.on_blue
|
11
|
+
|
12
|
+
Deployer::Executor.new(stage, verbose: verbose?) do |executor|
|
13
|
+
create_base_dirs(executor)
|
14
|
+
|
15
|
+
|
16
|
+
update_cached_copy(executor)
|
17
|
+
|
18
|
+
|
19
|
+
# fetch processor_names unless they have been passed as an argument to the initializer
|
20
|
+
processor_names_to_deploy = resolve_processor_names(executor, options)
|
21
|
+
processor_names_to_deploy.each do |processor_name|
|
22
|
+
puts
|
23
|
+
puts "Deploying #{processor_name}".light_blue.on_blue
|
24
|
+
log_deployment(executor, "Deploying #{processor_name} via #{deploy_via} from #{cached_copy_dir}")
|
25
|
+
# stop old one
|
26
|
+
executor.execute("kill -s TERM $(cat #{File.join(pids_dir, processor_name)}.pid)", abort_on_error: false, comment: "This is not sooo important")
|
27
|
+
|
28
|
+
# unzip package
|
29
|
+
target = deploy_dir('ruby')
|
30
|
+
source = cached_copy_dir('ruby',"#{processor_name}.zip")
|
31
|
+
executor.execute("rm -rf #{processor_dir(processor_name)} && unzip -o -d #{target} #{source}")
|
32
|
+
|
33
|
+
# copy config
|
34
|
+
executor.execute("if [[ -d #{config_source_dir(processor_name)} ]] ; then cp -r #{config_source_dir(processor_name)}/* #{processor_dir(processor_name)}; fi")
|
35
|
+
|
36
|
+
# remove log dir if it exists
|
37
|
+
executor.execute("if [[ -d #{processor_dir(processor_name, 'logs')} ]] ; then rm -rf #{processor_dir(processor_name, 'logs')}; fi")
|
38
|
+
|
39
|
+
# symlink log dir
|
40
|
+
executor.execute("ln -s #{logs_dir} #{processor_dir(processor_name, 'logs')}")
|
41
|
+
|
42
|
+
# symlink pids dir
|
43
|
+
executor.execute("ln -s #{pids_dir} #{processor_dir(processor_name, 'pids')}")
|
44
|
+
|
45
|
+
# install gems
|
46
|
+
executor.execute("cd #{processor_dir(processor_name)} && bundle install --without test")
|
47
|
+
|
48
|
+
# start new one
|
49
|
+
executor.execute("cd #{processor_dir(processor_name)} && bundle exec ruby #{processor_name}.rb -d -e $EH_ENV")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def update_cached_copy(executor)
|
57
|
+
if via_scp?
|
58
|
+
source = Eh::Settings.current.releases_dir('ruby', '*.zip')
|
59
|
+
target_dir = File.join(cached_copy_dir, 'ruby')
|
60
|
+
executor.execute("rm -rf #{target_dir}/*.zip && mkdir -p #{target_dir}")
|
61
|
+
executor.upload(source, target_dir)
|
62
|
+
else
|
63
|
+
update_scm(executor)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def logs_dir
|
68
|
+
File.join(shared_dir, 'logs')
|
69
|
+
end
|
70
|
+
|
71
|
+
def pids_dir
|
72
|
+
File.join(shared_dir, 'pids')
|
73
|
+
end
|
74
|
+
|
75
|
+
def deploy_dir(*extra_paths)
|
76
|
+
File.join(base_dir, *extra_paths)
|
77
|
+
end
|
78
|
+
|
79
|
+
def processor_dir(*extra_paths)
|
80
|
+
File.join(deploy_dir, 'ruby', *extra_paths)
|
81
|
+
end
|
82
|
+
|
83
|
+
def config_source_dir(processor_name)
|
84
|
+
super('ruby', processor_name)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Detect what processors to deploy
|
88
|
+
#
|
89
|
+
def resolve_processor_names(executor, options)
|
90
|
+
available = remote_ls(executor, options, File.join(cached_copy_dir, 'ruby', '*.zip')).map do |name|
|
91
|
+
File.basename(name, '.zip')
|
92
|
+
end
|
93
|
+
|
94
|
+
fetched = Array(processor_names).map do |name|
|
95
|
+
if name.include?('*') # resolve pattern on remote machine
|
96
|
+
remote_ls(executor, options, File.join(cached_copy_dir, 'ruby', "#{name}.zip"))
|
97
|
+
else
|
98
|
+
name
|
99
|
+
end
|
100
|
+
end
|
101
|
+
if fetched.empty? # then fetch all
|
102
|
+
fetched = available
|
103
|
+
end
|
104
|
+
|
105
|
+
fetched = fetched.flatten.map do |name|
|
106
|
+
File.basename(name, '.zip')
|
107
|
+
end
|
108
|
+
|
109
|
+
verify_deployment_list!(fetched, available)
|
110
|
+
|
111
|
+
fetched
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
data/lib/deployer/stage.rb
CHANGED
@@ -1,36 +1,36 @@
|
|
1
|
-
class Deployer::Stage
|
2
|
-
attr_reader :name, :hosts
|
3
|
-
|
4
|
-
def initialize(name)
|
5
|
-
@name = name
|
6
|
-
@hosts = []
|
7
|
-
end
|
8
|
-
|
9
|
-
def host(host, port, user)
|
10
|
-
@hosts << {
|
11
|
-
host: host,
|
12
|
-
port: port,
|
13
|
-
user: user
|
14
|
-
}
|
15
|
-
self
|
16
|
-
end
|
17
|
-
|
18
|
-
# returns a new stage which only contains one host
|
19
|
-
#
|
20
|
-
def single_host_stage
|
21
|
-
stage = Deployer::Stage.new(name)
|
22
|
-
stage.host(hosts[0][:host], hosts[0][:port], hosts[0][:user])
|
23
|
-
stage
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.load(name, file)
|
27
|
-
data = YAML.load_file(file)
|
28
|
-
data.map do |_, config|
|
29
|
-
stage = Deployer::Stage.new(name)
|
30
|
-
config['hosts'].each do |host|
|
31
|
-
stage.host(host['host'], host['port'], host['user'])
|
32
|
-
end
|
33
|
-
stage
|
34
|
-
end.first
|
35
|
-
end
|
36
|
-
end
|
1
|
+
class Deployer::Stage
|
2
|
+
attr_reader :name, :hosts
|
3
|
+
|
4
|
+
def initialize(name)
|
5
|
+
@name = name
|
6
|
+
@hosts = []
|
7
|
+
end
|
8
|
+
|
9
|
+
def host(host, port, user)
|
10
|
+
@hosts << {
|
11
|
+
host: host,
|
12
|
+
port: port,
|
13
|
+
user: user
|
14
|
+
}
|
15
|
+
self
|
16
|
+
end
|
17
|
+
|
18
|
+
# returns a new stage which only contains one host
|
19
|
+
#
|
20
|
+
def single_host_stage
|
21
|
+
stage = Deployer::Stage.new(name)
|
22
|
+
stage.host(hosts[0][:host], hosts[0][:port], hosts[0][:user])
|
23
|
+
stage
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.load(name, file)
|
27
|
+
data = YAML.load_file(file)
|
28
|
+
data.map do |_, config|
|
29
|
+
stage = Deployer::Stage.new(name)
|
30
|
+
config['hosts'].each do |host|
|
31
|
+
stage.host(host['host'], host['port'], host['user'])
|
32
|
+
end
|
33
|
+
stage
|
34
|
+
end.first
|
35
|
+
end
|
36
|
+
end
|
data/lib/deployer.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
module Deployer
|
2
|
-
end
|
3
|
-
|
4
|
-
require_relative 'deployer/executor'
|
5
|
-
require_relative 'deployer/net_ssh_extension'
|
6
|
-
require_relative 'deployer/stage'
|
7
|
-
|
8
|
-
require_relative 'deployer/base_deployer'
|
9
|
-
require_relative 'deployer/mule_deployer'
|
10
|
-
require_relative 'deployer/ruby_deployer'
|
11
|
-
require_relative 'deployer/config_deployer'
|
12
|
-
require_relative 'deployer/console_deployer'
|
1
|
+
module Deployer
|
2
|
+
end
|
3
|
+
|
4
|
+
require_relative 'deployer/executor'
|
5
|
+
require_relative 'deployer/net_ssh_extension'
|
6
|
+
require_relative 'deployer/stage'
|
7
|
+
|
8
|
+
require_relative 'deployer/base_deployer'
|
9
|
+
require_relative 'deployer/mule_deployer'
|
10
|
+
require_relative 'deployer/ruby_deployer'
|
11
|
+
require_relative 'deployer/config_deployer'
|
12
|
+
require_relative 'deployer/console_deployer'
|
@@ -1,23 +1,23 @@
|
|
1
|
-
desc 'deploy a single channel adapter'
|
2
|
-
arg_name '[channel_adapter[,other_channel_adapter,pattern*]]'
|
3
|
-
|
4
|
-
command :deploy_mule do |c|
|
5
|
-
c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where channel adapter is deployed to', default_value: Eh::Settings.current.default_stage)
|
6
|
-
c.flag([:deploy_via], desc: 'how to get hold of the channel adapter: scm or scp', type: String, long_desc: 'copy the channel adapter zip file via scp from this machine or check it out from scm', default_value: 'svn')
|
7
|
-
|
8
|
-
c.switch([:v, :verbose], :desc => 'Show additional output.')
|
9
|
-
|
10
|
-
c.action do |global_options, options, args|
|
11
|
-
begin
|
12
|
-
if args[0]
|
13
|
-
adapter_names = args[0].split(',').map(&:strip)
|
14
|
-
else
|
15
|
-
adapter_names = nil
|
16
|
-
end
|
17
|
-
Deployer::MuleDeployer.new(adapter_names, options).deploy!
|
18
|
-
rescue => e
|
19
|
-
puts e.message
|
20
|
-
puts e.backtrace.join("\n")
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
1
|
+
desc 'deploy a single channel adapter'
|
2
|
+
arg_name '[channel_adapter[,other_channel_adapter,pattern*]]'
|
3
|
+
|
4
|
+
command :deploy_mule do |c|
|
5
|
+
c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where channel adapter is deployed to', default_value: Eh::Settings.current.default_stage)
|
6
|
+
c.flag([:deploy_via], desc: 'how to get hold of the channel adapter: scm or scp', type: String, long_desc: 'copy the channel adapter zip file via scp from this machine or check it out from scm', default_value: 'svn')
|
7
|
+
|
8
|
+
c.switch([:v, :verbose], :desc => 'Show additional output.')
|
9
|
+
|
10
|
+
c.action do |global_options, options, args|
|
11
|
+
begin
|
12
|
+
if args[0]
|
13
|
+
adapter_names = args[0].split(',').map(&:strip)
|
14
|
+
else
|
15
|
+
adapter_names = nil
|
16
|
+
end
|
17
|
+
Deployer::MuleDeployer.new(adapter_names, options).deploy!
|
18
|
+
rescue => e
|
19
|
+
puts e.message
|
20
|
+
puts e.backtrace.join("\n")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|