eventhub-command 0.0.22 → 0.1.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/.gitignore +17 -17
- data/Gemfile +2 -2
- data/README.md +52 -29
- data/Rakefile +44 -44
- data/bin/eh +39 -39
- data/eh.gemspec +31 -28
- data/eh.rdoc +4 -4
- data/features/eh.feature +8 -8
- data/features/step_definitions/eh_steps.rb +6 -6
- data/features/support/env.rb +15 -15
- data/lib/deployer.rb +6 -0
- data/lib/deployer/executor.rb +102 -0
- data/lib/deployer/net_ssh_extension.rb +37 -0
- data/lib/deployer/stage.rb +28 -0
- data/lib/eh-commands.rb +8 -6
- data/lib/eh.rb +11 -7
- data/lib/eh/commands/copy_config.rb +51 -51
- data/lib/eh/commands/deploy.rb +38 -38
- data/lib/eh/commands/deploy_mule.rb +67 -0
- data/lib/eh/commands/deploy_ruby.rb +87 -0
- data/lib/eh/commands/generate_processor.rb +90 -90
- data/lib/eh/commands/package.rb +104 -104
- data/lib/eh/commands/package_rails.rb +68 -70
- data/lib/eh/settings.rb +72 -69
- data/lib/eh/version.rb +3 -3
- data/test/default_test.rb +14 -14
- data/test/test_helper.rb +9 -9
- data/todo.txt +8 -8
- metadata +37 -3
@@ -1,70 +1,68 @@
|
|
1
|
-
desc 'Packages Rails Console to zip file'
|
2
|
-
command :package_rails do |c|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
c.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
files
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
filename
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
end
|
70
|
-
end
|
1
|
+
desc 'Packages Rails Console to zip file'
|
2
|
+
command :package_rails do |c|
|
3
|
+
c.flag([:d, :destination], :desc => "Destination directory to place created zip file.", :default_value => Eh::Settings.current.rails_release_dir)
|
4
|
+
c.flag([:s, :source], :desc => "Source directory to read rails console from.", :default_value => Eh::Settings.current.rails_src_dir)
|
5
|
+
|
6
|
+
c.action do |global_options, options, args|
|
7
|
+
source_dir = options['s']
|
8
|
+
destination_dir = options['d']
|
9
|
+
|
10
|
+
skip_files = ["#{source_dir}/config/database.yml"]
|
11
|
+
|
12
|
+
puts "Will package rails console from #{source_dir} to #{destination_dir}"
|
13
|
+
|
14
|
+
console = Dir["#{source_dir}"]
|
15
|
+
|
16
|
+
FileUtils.mkdir_p(destination_dir)
|
17
|
+
|
18
|
+
zipfile_name = File.join(destination_dir, "console.zip")
|
19
|
+
directory = source_dir
|
20
|
+
|
21
|
+
# remove zip before we create a new one
|
22
|
+
FileUtils.rm zipfile_name, :force => true
|
23
|
+
|
24
|
+
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
|
25
|
+
|
26
|
+
#zipfile.add(processor_name, directory)
|
27
|
+
[directory].each do |file_to_be_zipped|
|
28
|
+
if File.directory?(file_to_be_zipped)
|
29
|
+
# should skip directories
|
30
|
+
next if options["directories-skip"]
|
31
|
+
|
32
|
+
directory = file_to_be_zipped
|
33
|
+
puts "zipper: archiving directory: #{directory}"
|
34
|
+
directory_chosen_pathname = options["directories-recursively-splat"] ? directory : File.dirname(directory)
|
35
|
+
directory_pathname = Pathname.new(directory_chosen_pathname)
|
36
|
+
files = Dir[File.join(directory, '**', '**')]
|
37
|
+
|
38
|
+
files.delete_if do |filename|
|
39
|
+
["#{source_dir}/log", "#{source_dir}/logs", "#{source_dir}/exceptions", "#{source_dir}/tmp"].any? do |prefix|
|
40
|
+
filename.start_with?(prefix)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
files.each do |file|
|
45
|
+
if skip_files.include? file
|
46
|
+
puts "skipping #{file}"
|
47
|
+
next
|
48
|
+
end
|
49
|
+
|
50
|
+
file_pathname = Pathname.new(file)
|
51
|
+
file_relative_pathname = file_pathname.relative_path_from(directory_pathname)
|
52
|
+
zipfile.add(file_relative_pathname,file)
|
53
|
+
end
|
54
|
+
|
55
|
+
next
|
56
|
+
end
|
57
|
+
|
58
|
+
filename = File.basename(file_to_be_zipped)
|
59
|
+
|
60
|
+
puts "zipper: archiving #{file_to_be_zipped} as #{filename} into #{zipfile}"
|
61
|
+
|
62
|
+
zipfile.add(filename,file_to_be_zipped)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
puts "Done packaging rails"
|
67
|
+
end
|
68
|
+
end
|
data/lib/eh/settings.rb
CHANGED
@@ -1,69 +1,72 @@
|
|
1
|
-
class Eh::Settings
|
2
|
-
attr_reader :data
|
3
|
-
def self.load(file)
|
4
|
-
data = File.read(file)
|
5
|
-
json = JSON.parse(data)
|
6
|
-
Eh::Settings.new(json)
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.current=(value)
|
10
|
-
Thread.current[:eh_settings] = value
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.current
|
14
|
-
Thread.current[:eh_settings]
|
15
|
-
end
|
16
|
-
|
17
|
-
def initialize(data)
|
18
|
-
@data = data
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
1
|
+
class Eh::Settings
|
2
|
+
attr_reader :data
|
3
|
+
def self.load(file)
|
4
|
+
data = File.read(file)
|
5
|
+
json = JSON.parse(data)
|
6
|
+
Eh::Settings.new(json)
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.current=(value)
|
10
|
+
Thread.current[:eh_settings] = value
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.current
|
14
|
+
Thread.current[:eh_settings]
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize(data)
|
18
|
+
@data = data
|
19
|
+
end
|
20
|
+
|
21
|
+
def repository_root_dir
|
22
|
+
File.expand_path(data['repository_root_dir'])
|
23
|
+
end
|
24
|
+
|
25
|
+
def releases_dir
|
26
|
+
File.join(repository_root_dir, 'releases')
|
27
|
+
end
|
28
|
+
|
29
|
+
def rails_release_dir
|
30
|
+
File.join(releases_dir, 'rails')
|
31
|
+
end
|
32
|
+
|
33
|
+
def ruby_release_dir
|
34
|
+
File.join(releases_dir, 'ruby')
|
35
|
+
end
|
36
|
+
|
37
|
+
def processors_src_dir
|
38
|
+
File.join(repository_root_dir, 'src', 'ruby')
|
39
|
+
end
|
40
|
+
|
41
|
+
def deployment_dir
|
42
|
+
File.join(repository_root_dir, 'src', 'deployment')
|
43
|
+
end
|
44
|
+
|
45
|
+
def rails_src_dir
|
46
|
+
File.join(repository_root_dir, 'src', 'rails', 'console')
|
47
|
+
end
|
48
|
+
|
49
|
+
def source_config_dir
|
50
|
+
File.join(repository_root_dir, 'config')
|
51
|
+
end
|
52
|
+
|
53
|
+
def processor_template_repository_url
|
54
|
+
'https://github.com/thomis/eventhub-processor-template.git'
|
55
|
+
end
|
56
|
+
|
57
|
+
def package_tmp_dir
|
58
|
+
'./tmp'
|
59
|
+
end
|
60
|
+
|
61
|
+
def template_tmp_dir
|
62
|
+
'/tmp/eventhub-processor-template/'
|
63
|
+
end
|
64
|
+
|
65
|
+
def deployment_management_files
|
66
|
+
[ File.join(deployment_dir, 'management', 'launcher.rb') ]
|
67
|
+
end
|
68
|
+
|
69
|
+
def stages_dir
|
70
|
+
File.expand_path("~/.eh-stages")
|
71
|
+
end
|
72
|
+
end
|
data/lib/eh/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module Eh
|
2
|
-
VERSION = '0.0
|
3
|
-
end
|
1
|
+
module Eh
|
2
|
+
VERSION = '0.1.0'
|
3
|
+
end
|
data/test/default_test.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class DefaultTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
end
|
7
|
-
|
8
|
-
def teardown
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_the_truth
|
12
|
-
assert true
|
13
|
-
end
|
14
|
-
end
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class DefaultTest < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
end
|
7
|
+
|
8
|
+
def teardown
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_the_truth
|
12
|
+
assert true
|
13
|
+
end
|
14
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
|
3
|
-
# Add test libraries you want to use here, e.g. mocha
|
4
|
-
|
5
|
-
class Test::Unit::TestCase
|
6
|
-
|
7
|
-
# Add global extensions to the test case class here
|
8
|
-
|
9
|
-
end
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
# Add test libraries you want to use here, e.g. mocha
|
4
|
+
|
5
|
+
class Test::Unit::TestCase
|
6
|
+
|
7
|
+
# Add global extensions to the test case class here
|
8
|
+
|
9
|
+
end
|
data/todo.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
-- -------------------------------------
|
2
|
-
-- to do
|
3
|
-
-- -------------------------------------
|
4
|
-
|
5
|
-
- eh relase -r or --repository plate_store or http path -u user -p password
|
6
|
-
- folder filter, default and customize
|
7
|
-
- extension filter, default and custmize
|
8
|
-
- it could take config settings from a local .ehconfig file
|
1
|
+
-- -------------------------------------
|
2
|
+
-- to do
|
3
|
+
-- -------------------------------------
|
4
|
+
|
5
|
+
- eh relase -r or --repository plate_store or http path -u user -p password
|
6
|
+
- folder filter, default and customize
|
7
|
+
- extension filter, default and custmize
|
8
|
+
- it could take config settings from a local .ehconfig file
|
9
9
|
- would be nice to have a release all feature
|
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.0
|
4
|
+
version: 0.1.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: 2014-
|
12
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -95,6 +95,34 @@ dependencies:
|
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '4.1'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: net-ssh
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :runtime
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: colorize
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :runtime
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
98
126
|
description: Event Hub Command Line Tool which supports you with various Event Hub
|
99
127
|
related administrative development features.
|
100
128
|
email:
|
@@ -117,10 +145,16 @@ files:
|
|
117
145
|
- features/eh.feature
|
118
146
|
- features/step_definitions/eh_steps.rb
|
119
147
|
- features/support/env.rb
|
148
|
+
- lib/deployer.rb
|
149
|
+
- lib/deployer/executor.rb
|
150
|
+
- lib/deployer/net_ssh_extension.rb
|
151
|
+
- lib/deployer/stage.rb
|
120
152
|
- lib/eh-commands.rb
|
121
153
|
- lib/eh.rb
|
122
154
|
- lib/eh/commands/copy_config.rb
|
123
155
|
- lib/eh/commands/deploy.rb
|
156
|
+
- lib/eh/commands/deploy_mule.rb
|
157
|
+
- lib/eh/commands/deploy_ruby.rb
|
124
158
|
- lib/eh/commands/generate_processor.rb
|
125
159
|
- lib/eh/commands/package.rb
|
126
160
|
- lib/eh/commands/package_rails.rb
|
@@ -155,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
189
|
version: '0'
|
156
190
|
requirements: []
|
157
191
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.4.
|
192
|
+
rubygems_version: 2.4.3
|
159
193
|
signing_key:
|
160
194
|
specification_version: 4
|
161
195
|
summary: Event Hub Command Line Tool
|