eventhub-command 0.3.14 → 0.4.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 +4 -4
- data/lib/deployer.rb +1 -0
- data/lib/deployer/console_deployer.rb +12 -33
- data/lib/eh-commands.rb +1 -3
- data/lib/eh/commands/deploy.rb +111 -0
- data/lib/eh/proxy/proxy.rb +1 -0
- data/lib/eh/version.rb +1 -1
- metadata +3 -6
- data/lib/eh/commands/deploy_config.rb +0 -13
- data/lib/eh/commands/deploy_console.rb +0 -14
- data/lib/eh/commands/deploy_mule.rb +0 -23
- data/lib/eh/commands/deploy_ruby.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5146bf51057042c4f7ab5a36895dd7e039ac162e
|
4
|
+
data.tar.gz: 10cdad8b9dd1867d312734dc3005cbcc345e16ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52d2eef34897bf5207f7e2f57d19cbdea64ccd4a7dd56f318e6e2b24128348f577def951edb7dd70ff204ae977d29151241a99944e1780d8bbf91ab08d3d8730
|
7
|
+
data.tar.gz: 0993f713103cfe7121f8187e4090f20b459d1f1050831cc5d2a905498eb34154ad0f8145d19450b711d96a1e12231769fd11352d8cbe3a7c98c38b658acdfaf6
|
data/lib/deployer.rb
CHANGED
@@ -1,45 +1,24 @@
|
|
1
1
|
class Deployer::ConsoleDeployer < Deployer::BaseDeployer
|
2
2
|
|
3
|
+
def initialize(options)
|
4
|
+
@options = options
|
5
|
+
end
|
6
|
+
|
3
7
|
def deploy!
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
+
Bundler.with_clean_env do
|
9
|
+
Dir.chdir(console_dir) do
|
10
|
+
system "bundle install && cap #{stage} deploy"
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|
10
14
|
|
11
15
|
private
|
12
16
|
|
13
|
-
def
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
def deploy_via_scp
|
18
|
-
cmd = "cd #{working_dir} && bundle install && bundle exec cap #{stage.name} deploy"
|
19
|
-
execute_in_clean_env(cmd)
|
20
|
-
end
|
21
|
-
|
22
|
-
def deploy_via_svn
|
23
|
-
console_release_zip = '~/apps/event_hub/shared/cached_copy_svn/branches/master/releases/rails/console.zip'
|
24
|
-
cmds = []
|
25
|
-
cmds << "rm -rf /tmp/console_deployment && mkdir -p /tmp/console_deployment"
|
26
|
-
cmds << "cd /tmp/console_deployment && unzip #{console_release_zip} -d ."
|
27
|
-
cmds << "cd /tmp/console_deployment/console && bundle install && bundle exec cap #{stage.name} deploy"
|
28
|
-
# run the command only on one host of this stage.
|
29
|
-
Deployer::Executor.new(stage.single_host_stage, verbose: verbose?) do |executor|
|
30
|
-
update_scm(executor)
|
31
|
-
cmds.each do |cmd|
|
32
|
-
executor.execute(cmd)
|
33
|
-
end
|
34
|
-
end
|
17
|
+
def console_dir
|
18
|
+
Eh::Settings.current.console_source_dir
|
35
19
|
end
|
36
20
|
|
37
|
-
def
|
38
|
-
|
39
|
-
Bundler.with_clean_env do
|
40
|
-
system cmd
|
41
|
-
end
|
21
|
+
def stage
|
22
|
+
@options.fetch(:stage, 'development')
|
42
23
|
end
|
43
|
-
|
44
|
-
|
45
24
|
end
|
data/lib/eh-commands.rb
CHANGED
@@ -4,12 +4,10 @@ if Eh::Settings.current.repository
|
|
4
4
|
require 'eh/commands/package_ruby'
|
5
5
|
require 'eh/commands/package_rails'
|
6
6
|
require 'eh/commands/stage'
|
7
|
-
require 'eh/commands/deploy_config'
|
8
|
-
require 'eh/commands/deploy_ruby'
|
9
|
-
require 'eh/commands/deploy_mule'
|
10
7
|
require 'eh/commands/dump'
|
11
8
|
require 'eh/commands/db'
|
12
9
|
require 'eh/commands/proxy'
|
10
|
+
require 'eh/commands/deploy'
|
13
11
|
require 'eh/proxy/proxy'
|
14
12
|
else
|
15
13
|
# remove unused settings for this version
|
@@ -0,0 +1,111 @@
|
|
1
|
+
desc 'deployment commands'
|
2
|
+
command :deploy do |c|
|
3
|
+
c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: Eh::Settings.current.default_stage)
|
4
|
+
c.flag([:branch], desc: 'branch', type: String, long_desc: 'What branch to deploy. Only when deploy_via=scm', default_value: 'master')
|
5
|
+
c.flag([:tag], desc: 'tag', type: String, long_desc: 'What tag to deploy. Only when deploy_via=scm', default_value: nil)
|
6
|
+
c.switch([:v, :verbose], :desc => 'Show additional output.')
|
7
|
+
c.flag([:deploy_via], desc: 'where to deploy from', type: String, long_desc: 'deploy via scm or scp. If you use scp then the working_dir is packaged and copied tot the servers', default_value: 'svn')
|
8
|
+
|
9
|
+
c.command :all do |c|
|
10
|
+
c.desc 'deploy all'
|
11
|
+
c.action do |global_options, options, arguments|
|
12
|
+
forward_arguments = arguments.join(' ')
|
13
|
+
deploy_config(options, forward_arguments)
|
14
|
+
deploy_ruby(options, forward_arguments)
|
15
|
+
deploy_mule(options, forward_arguments)
|
16
|
+
deploy_console(options, forward_arguments)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
c.command :config do |c|
|
21
|
+
c.desc 'distribute the configs to the nodes'
|
22
|
+
c.action do |global_options, options, args|
|
23
|
+
Deployer::ConfigDeployer.new(options).deploy!
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'deploy the rails console app'
|
28
|
+
c.command :console do |c|
|
29
|
+
c.flag([:working_dir], desc: 'directory to execute commands in', type: String, default_value: '.')
|
30
|
+
|
31
|
+
c.action do |global_options, options, args|
|
32
|
+
Deployer::ConsoleDeployer.new(options).deploy!
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
c.command :mule do |c|
|
38
|
+
c.desc 'deploy a single channel adapter'
|
39
|
+
c.arg_name '[channel_adapter[,other_channel_adapter,pattern*]]'
|
40
|
+
|
41
|
+
c.action do |global_options, options, args|
|
42
|
+
begin
|
43
|
+
if args[0]
|
44
|
+
adapter_names = args[0].split(',').map(&:strip)
|
45
|
+
else
|
46
|
+
adapter_names = nil
|
47
|
+
end
|
48
|
+
Deployer::MuleDeployer.new(adapter_names, options).deploy!
|
49
|
+
rescue => e
|
50
|
+
puts e.message
|
51
|
+
puts e.backtrace.join("\n")
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
c.command :ruby do |c|
|
57
|
+
c.desc 'deploy a single ruby processor'
|
58
|
+
c.arg_name '[processor_name,[other_processor_name,pattern*]]'
|
59
|
+
|
60
|
+
c.action do |global_options, options, args|
|
61
|
+
begin
|
62
|
+
if args[0]
|
63
|
+
processor_names = args[0].split(',').map(&:strip)
|
64
|
+
else
|
65
|
+
processor_names = nil
|
66
|
+
end
|
67
|
+
Deployer::RubyDeployer.new(processor_names, options).deploy!
|
68
|
+
rescue => e
|
69
|
+
puts e.message
|
70
|
+
puts e.backtrace.join("\n")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
def deploy_ruby(options, forward_arguments)
|
80
|
+
system "#{extend_command('deploy ruby')} #{copy_options(options, :stage, :branch, :tag, :verbose)} #{forward_arguments}"
|
81
|
+
end
|
82
|
+
|
83
|
+
def deploy_console(options, forward_arguments)
|
84
|
+
system "#{extend_command('deploy console')} #{copy_options(options, :stage)} #{forward_arguments}"
|
85
|
+
end
|
86
|
+
|
87
|
+
def deploy_mule(options, forward_arguments)
|
88
|
+
system "#{extend_command(:deploy_mule)} #{copy_options(options, :stage, :verbose)} #{forward_arguments}"
|
89
|
+
end
|
90
|
+
|
91
|
+
def deploy_config(options, forward_arguments)
|
92
|
+
system "#{extend_command('deploy config')} #{copy_options(options, :stage, :branch, :tag, :verbose)} #{forward_arguments}"
|
93
|
+
end
|
94
|
+
|
95
|
+
def copy_option(options, option)
|
96
|
+
if options[option]
|
97
|
+
"--#{option}=#{options[option]}"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def copy_options(options, *selected)
|
102
|
+
selected.map do |name|
|
103
|
+
copy_option(options, name)
|
104
|
+
end.compact.join(' ')
|
105
|
+
end
|
106
|
+
|
107
|
+
def extend_command(command)
|
108
|
+
"bundle exec eh #{command}"
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
data/lib/eh/proxy/proxy.rb
CHANGED
data/lib/eh/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventhub-command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pascal Betz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-11-
|
12
|
+
date: 2015-11-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -182,10 +182,7 @@ files:
|
|
182
182
|
- lib/eh-commands.rb
|
183
183
|
- lib/eh.rb
|
184
184
|
- lib/eh/commands/db.rb
|
185
|
-
- lib/eh/commands/
|
186
|
-
- lib/eh/commands/deploy_console.rb
|
187
|
-
- lib/eh/commands/deploy_mule.rb
|
188
|
-
- lib/eh/commands/deploy_ruby.rb
|
185
|
+
- lib/eh/commands/deploy.rb
|
189
186
|
- lib/eh/commands/dump.rb
|
190
187
|
- lib/eh/commands/generate_processor.rb
|
191
188
|
- lib/eh/commands/package_rails.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
desc 'distribute the configs to the nodes'
|
2
|
-
|
3
|
-
command :deploy_config do |c|
|
4
|
-
c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: Eh::Settings.current.default_stage)
|
5
|
-
c.flag([:branch], desc: 'branch', type: String, long_desc: 'What branch to deploy. Only when deploy_via=scm', default_value: 'master')
|
6
|
-
c.flag([:tag], desc: 'tag', type: String, long_desc: 'What tag to deploy. Only when deploy_via=scm', default_value: nil)
|
7
|
-
|
8
|
-
c.switch([:v, :verbose], :desc => 'Show additional output.')
|
9
|
-
|
10
|
-
c.action do |global_options, options, args|
|
11
|
-
Deployer::ConfigDeployer.new(options).deploy!
|
12
|
-
end
|
13
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
desc 'deploy the console rails app'
|
2
|
-
|
3
|
-
command :deploy_console do |c|
|
4
|
-
c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: Eh::Settings.current.default_stage)
|
5
|
-
c.flag([:branch], desc: 'branch', type: String, long_desc: 'What branch to deploy. Only when deploy_via=scm', default_value: 'master')
|
6
|
-
c.flag([:tag], desc: 'tag', type: String, long_desc: 'What tag to deploy. Only when deploy_via=scm', default_value: nil)
|
7
|
-
c.flag([:deploy_via], desc: 'where to deploy from', type: String, long_desc: 'deploy via scm or scp. If you use scp then the working_dir is packaged and copied tot the servers', default_value: 'svn')
|
8
|
-
c.flag([:working_dir], desc: 'directory to execute commands in', type: String, default_value: '.')
|
9
|
-
c.switch([:v, :verbose], :desc => 'Show additional output.')
|
10
|
-
|
11
|
-
c.action do |global_options, options, args|
|
12
|
-
Deployer::ConsoleDeployer.new(options).deploy!
|
13
|
-
end
|
14
|
-
end
|
@@ -1,23 +0,0 @@
|
|
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,25 +0,0 @@
|
|
1
|
-
desc 'deploy a single ruby processor'
|
2
|
-
arg_name '[processor_name,[other_processor_name,pattern*]]'
|
3
|
-
|
4
|
-
command :deploy_ruby do |c|
|
5
|
-
c.flag([:stage], desc: 'stage', type: String, long_desc: 'Stage where processor is deployed to', default_value: Eh::Settings.current.default_stage)
|
6
|
-
c.flag([:deploy_via], desc: 'how to get hold of the processor: scm or scp', type: String, long_desc: 'copy the processor zip file via scp from this machine or check it out from scm', default_value: 'svn')
|
7
|
-
c.flag([:branch], desc: 'branch', type: String, long_desc: 'What branch to deploy. Only when deploy_via=scm', default_value: 'master')
|
8
|
-
c.flag([:tag], desc: 'tag', type: String, long_desc: 'What tag to deploy. Only when deploy_via=scm', default_value: nil)
|
9
|
-
|
10
|
-
c.switch([:v, :verbose], :desc => 'Show additional output.')
|
11
|
-
|
12
|
-
c.action do |global_options, options, args|
|
13
|
-
begin
|
14
|
-
if args[0]
|
15
|
-
processor_names = args[0].split(',').map(&:strip)
|
16
|
-
else
|
17
|
-
processor_names = nil
|
18
|
-
end
|
19
|
-
Deployer::RubyDeployer.new(processor_names, options).deploy!
|
20
|
-
rescue => e
|
21
|
-
puts e.message
|
22
|
-
puts e.backtrace.join("\n")
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|