eventhub-command 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -40
- data/eh.gemspec +2 -2
- data/lib/deployer/base_deployer.rb +8 -0
- data/lib/deployer/go_deployer.rb +12 -2
- data/lib/deployer/ruby_deployer.rb +13 -2
- data/lib/eh/commands/deploy.rb +1 -0
- data/lib/eh/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65939586cae8203d4f51c16ac3fec73960c57e8c
|
4
|
+
data.tar.gz: 50efa36673dc5d89cf1182666996b11088d5d15d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52d79ab0db707bc639d684137ed410b7e6664dd00be78660d70ecee884c4aec5f9bcb20b2093be316c7a2cede1ec2cd0ac1c7e055104aab280da736ed580f76c
|
7
|
+
data.tar.gz: 3e39346183a378d645a9ada52056956f6c4435e0c895e56db5c031c179d9c6b2d52f9269b7872c24cdcafdb2e9069cc5510f7055006172fb94a56ffcd209ab47
|
data/README.md
CHANGED
@@ -3,9 +3,12 @@ eventhub-command
|
|
3
3
|
|
4
4
|
Event Hub Command Line Tool includes the following features
|
5
5
|
|
6
|
-
*
|
7
|
-
*
|
8
|
-
* Scaffold
|
6
|
+
* Dump and Restore database
|
7
|
+
* Deploy configurations files
|
8
|
+
* Scaffold, Packaging, and Deploy components
|
9
|
+
* Manage Repositories
|
10
|
+
* Manage Statges
|
11
|
+
* Manage Proxies
|
9
12
|
|
10
13
|
## Installation
|
11
14
|
|
@@ -37,16 +40,6 @@ Some commands (e.g. deploy commands) will use stages to determine where to deplo
|
|
37
40
|
stored in the eventhub SVN repository under config/ directory
|
38
41
|
|
39
42
|
The file name is the name of the stage, the content describes environments, hosts, ports and users to use.
|
40
|
-
Content looks like this:
|
41
|
-
|
42
|
-
~~~
|
43
|
-
localhost:
|
44
|
-
hosts:
|
45
|
-
- host: localhost
|
46
|
-
port: 2222
|
47
|
-
user: some_user
|
48
|
-
~~~
|
49
|
-
|
50
43
|
|
51
44
|
## Usage
|
52
45
|
|
@@ -60,31 +53,4 @@ and more specific for a single command
|
|
60
53
|
eh <COMMAND> --help
|
61
54
|
~~~
|
62
55
|
|
63
|
-
### Common options
|
64
|
-
|
65
|
-
Some common options are:
|
66
|
-
|
67
|
-
* --stage (one of the names that are listed from list_stages command)
|
68
|
-
* --deploy_via (use svn or scp for deployment. If scp, then the local release directory is used, otherwise svn)
|
69
|
-
* --branch/--tag (specify a branch or tag to use for "deploy_via scp")
|
70
|
-
* --verbose (enable verbose output)
|
71
|
-
|
72
|
-
### Commands
|
73
|
-
* deploy_ruby: deploy a ruby processor to a stage. You can specify:
|
74
|
-
* a processor name
|
75
|
-
* multiple processor names spearated via commas
|
76
|
-
* a pattern like something.*
|
77
|
-
* a combination of above
|
78
|
-
* deploy_mule: deploy a mule adapter to a stage
|
79
|
-
* a adapter name
|
80
|
-
* multiple adapter names spearated via commas
|
81
|
-
* a pattern like something.*
|
82
|
-
* a combination of above
|
83
|
-
* deploy_config: checkout the latest version of config on target stage and copy to the config folder on stage.
|
84
|
-
Those config files will be used uppon next deployment.
|
85
|
-
* list_stages: list stages that are available for deploy_* commands
|
86
|
-
* package_ruby: package ruby processors to zip files and copy to release directory on local machines. Those packages
|
87
|
-
will be used upon next "deploy_via scp" or if you commit them to SVN then upon next "deploy_via svn"
|
88
|
-
* generate_processor: generate a processor from a basic template
|
89
|
-
|
90
56
|
|
data/eh.gemspec
CHANGED
@@ -26,6 +26,6 @@ spec = Gem::Specification.new do |s|
|
|
26
26
|
s.add_runtime_dependency('activesupport', '~> 4.1')
|
27
27
|
s.add_runtime_dependency('net-ssh', '~> 2.9')
|
28
28
|
s.add_runtime_dependency('colorize', '~> 0.7')
|
29
|
-
s.add_runtime_dependency('highline')
|
30
|
-
s.add_runtime_dependency('parseconfig')
|
29
|
+
s.add_runtime_dependency('highline', '~> 1.7')
|
30
|
+
s.add_runtime_dependency('parseconfig', '~> 1.0')
|
31
31
|
end
|
@@ -34,6 +34,10 @@ class Deployer::BaseDeployer
|
|
34
34
|
options[:verbose]
|
35
35
|
end
|
36
36
|
|
37
|
+
def inspector?
|
38
|
+
options[:inspector]
|
39
|
+
end
|
40
|
+
|
37
41
|
def via_scp?
|
38
42
|
deploy_via == 'scp'
|
39
43
|
end
|
@@ -146,4 +150,8 @@ class Deployer::BaseDeployer
|
|
146
150
|
|
147
151
|
end
|
148
152
|
|
153
|
+
def inspector_command(action, name)
|
154
|
+
"curl -X POST --data '[{\"name\": \"#{name}\",\"action\": \"#{action}\"}]' --header \"Content-Type:application/json\" http://localhost:5500/applications"
|
155
|
+
end
|
156
|
+
|
149
157
|
end
|
data/lib/deployer/go_deployer.rb
CHANGED
@@ -24,7 +24,12 @@ class Deployer::GoDeployer < Deployer::BaseDeployer
|
|
24
24
|
log_deployment(executor, "Deploying #{processor_name} via #{deploy_via} from #{cached_copy_dir}")
|
25
25
|
|
26
26
|
# stop old one
|
27
|
-
|
27
|
+
if inspector?
|
28
|
+
cmd = inspector_command('stop', processor_name)
|
29
|
+
executor.execute(cmd, abort_on_error: false, comment: "Request to stop component")
|
30
|
+
else
|
31
|
+
executor.execute("kill -s TERM $(cat #{File.join(pids_dir, processor_name)}.pid)", abort_on_error: false, comment: "This is not sooo important")
|
32
|
+
end
|
28
33
|
|
29
34
|
# unzip package
|
30
35
|
target = deploy_dir('go')
|
@@ -44,7 +49,12 @@ class Deployer::GoDeployer < Deployer::BaseDeployer
|
|
44
49
|
executor.execute("ln -s #{pids_dir} #{processor_dir(processor_name, 'pids')}")
|
45
50
|
|
46
51
|
# start new one
|
47
|
-
|
52
|
+
if inspector?
|
53
|
+
cmd = inspector_command('start', processor_name)
|
54
|
+
executor.execute(cmd, abort_on_error: false, comment: "Request to start component")
|
55
|
+
else
|
56
|
+
executor.execute("cd #{processor_dir(processor_name)} && ./#{processor_name} -d -e $EH_ENV")
|
57
|
+
end
|
48
58
|
end
|
49
59
|
end
|
50
60
|
end
|
@@ -22,8 +22,14 @@ class Deployer::RubyDeployer < Deployer::BaseDeployer
|
|
22
22
|
puts
|
23
23
|
puts "Deploying #{processor_name}".light_blue.on_blue
|
24
24
|
log_deployment(executor, "Deploying #{processor_name} via #{deploy_via} from #{cached_copy_dir}")
|
25
|
+
|
25
26
|
# stop old one
|
26
|
-
|
27
|
+
if inspector?
|
28
|
+
cmd = inspector_command('stop', processor_name)
|
29
|
+
executor.execute(cmd, abort_on_error: false, comment: "Request to stop component")
|
30
|
+
else
|
31
|
+
executor.execute("kill -s TERM $(cat #{File.join(pids_dir, processor_name)}.pid)", abort_on_error: false, comment: "This is not sooo important")
|
32
|
+
end
|
27
33
|
|
28
34
|
# unzip package
|
29
35
|
target = deploy_dir('ruby')
|
@@ -46,7 +52,12 @@ class Deployer::RubyDeployer < Deployer::BaseDeployer
|
|
46
52
|
executor.execute("cd #{processor_dir(processor_name)} && bundle install --without test")
|
47
53
|
|
48
54
|
# start new one
|
49
|
-
|
55
|
+
if inspector?
|
56
|
+
cmd = inspector_command('start', processor_name)
|
57
|
+
executor.execute(cmd, abort_on_error: false, comment: "Request to stop component")
|
58
|
+
else
|
59
|
+
executor.execute("cd #{processor_dir(processor_name)} && bundle exec ruby #{processor_name}.rb -d -e $EH_ENV")
|
60
|
+
end
|
50
61
|
end
|
51
62
|
end
|
52
63
|
end
|
data/lib/eh/commands/deploy.rb
CHANGED
@@ -5,6 +5,7 @@ command :deploy do |c|
|
|
5
5
|
c.flag([:tag], desc: 'tag', type: String, long_desc: 'What tag to deploy. Only when deploy_via=scm', default_value: nil)
|
6
6
|
c.switch([:v, :verbose], :desc => 'Show additional output.')
|
7
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.switch([:i, :inspector], desc: 'start/stop via inspector')
|
8
9
|
|
9
10
|
c.desc 'deploy all'
|
10
11
|
c.command :all do |c|
|
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.6.
|
4
|
+
version: 0.6.1
|
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: 2016-
|
12
|
+
date: 2016-05-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -127,30 +127,30 @@ dependencies:
|
|
127
127
|
name: highline
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- - "
|
130
|
+
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '
|
132
|
+
version: '1.7'
|
133
133
|
type: :runtime
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- - "
|
137
|
+
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: '
|
139
|
+
version: '1.7'
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: parseconfig
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
|
-
- - "
|
144
|
+
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: '0'
|
146
|
+
version: '1.0'
|
147
147
|
type: :runtime
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
|
-
- - "
|
151
|
+
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: '0'
|
153
|
+
version: '1.0'
|
154
154
|
description: Event Hub Command Line Tool which supports you with various Event Hub
|
155
155
|
related administrative development features.
|
156
156
|
email:
|