eventhub-command 0.3.11 → 0.3.12
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 +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
data/lib/eh/settings.rb
CHANGED
@@ -1,131 +1,131 @@
|
|
1
|
-
class Eh::Settings
|
2
|
-
|
3
|
-
attr_reader :data, :file
|
4
|
-
|
5
|
-
class Repository
|
6
|
-
def initialize(json)
|
7
|
-
@json = json
|
8
|
-
end
|
9
|
-
|
10
|
-
def url
|
11
|
-
@json['url']
|
12
|
-
end
|
13
|
-
|
14
|
-
def deploy_username
|
15
|
-
@json['deploy_username']
|
16
|
-
end
|
17
|
-
|
18
|
-
def deploy_password
|
19
|
-
@json['deploy_password']
|
20
|
-
end
|
21
|
-
|
22
|
-
def dir
|
23
|
-
@json['dir']
|
24
|
-
end
|
25
|
-
|
26
|
-
def current?
|
27
|
-
@json['current']
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def default_stage
|
32
|
-
@data['default_stage'] || 'development'
|
33
|
-
end
|
34
|
-
|
35
|
-
def initialize(file)
|
36
|
-
@file = file
|
37
|
-
@data = JSON.parse(File.read(file))
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.load(file)
|
41
|
-
Eh::Settings.new(file)
|
42
|
-
end
|
43
|
-
|
44
|
-
def write
|
45
|
-
File.open(file,"w") do |f|
|
46
|
-
f.write(data.to_json)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def self.current=(value)
|
51
|
-
Thread.current[:eh_settings] = value
|
52
|
-
end
|
53
|
-
|
54
|
-
def self.current
|
55
|
-
Thread.current[:eh_settings]
|
56
|
-
end
|
57
|
-
|
58
|
-
def repository
|
59
|
-
repositories.find do |repository|
|
60
|
-
repository.current?
|
61
|
-
end if repositories
|
62
|
-
end
|
63
|
-
|
64
|
-
def repositories
|
65
|
-
repos = data["repositories"].map do |json|
|
66
|
-
Eh::Settings::Repository.new(json)
|
67
|
-
end if data["repositories"]
|
68
|
-
repos || []
|
69
|
-
end
|
70
|
-
|
71
|
-
def releases_dir(*extra_paths)
|
72
|
-
File.join(repository.dir, 'releases', *extra_paths)
|
73
|
-
end
|
74
|
-
|
75
|
-
|
76
|
-
def rails_release_dir
|
77
|
-
releases_dir('rails')
|
78
|
-
end
|
79
|
-
|
80
|
-
def ruby_release_dir
|
81
|
-
releases_dir('ruby')
|
82
|
-
end
|
83
|
-
|
84
|
-
def processors_src_dir
|
85
|
-
File.join(repository.dir, 'src', 'ruby')
|
86
|
-
end
|
87
|
-
|
88
|
-
def rails_src_dir
|
89
|
-
File.join(repository.dir, 'src', 'rails')
|
90
|
-
end
|
91
|
-
|
92
|
-
def console_source_dir
|
93
|
-
File.join(repository.dir, 'src', 'rails', 'console')
|
94
|
-
end
|
95
|
-
|
96
|
-
def deployment_dir
|
97
|
-
File.join(repository.dir, 'src', 'deployment')
|
98
|
-
end
|
99
|
-
|
100
|
-
def rails_src_dir
|
101
|
-
File.join(repository.dir, 'src', 'rails', 'console')
|
102
|
-
end
|
103
|
-
|
104
|
-
def source_config_dir
|
105
|
-
File.join(repository.dir, 'config')
|
106
|
-
end
|
107
|
-
|
108
|
-
def processor_template_repository_url
|
109
|
-
'https://github.com/thomis/eventhub-processor-template.git'
|
110
|
-
end
|
111
|
-
|
112
|
-
def package_tmp_dir
|
113
|
-
'./tmp'
|
114
|
-
end
|
115
|
-
|
116
|
-
def template_tmp_dir
|
117
|
-
'/tmp/eventhub-processor-template/'
|
118
|
-
end
|
119
|
-
|
120
|
-
def deployment_management_files
|
121
|
-
[File.join(deployment_dir, 'management', 'launcher.rb')]
|
122
|
-
end
|
123
|
-
|
124
|
-
def stages_dir
|
125
|
-
File.join(repository.dir, 'config', 'stages')
|
126
|
-
end
|
127
|
-
|
128
|
-
def db_backups_dir
|
129
|
-
File.expand_path('~/backups')
|
130
|
-
end
|
131
|
-
end
|
1
|
+
class Eh::Settings
|
2
|
+
|
3
|
+
attr_reader :data, :file
|
4
|
+
|
5
|
+
class Repository
|
6
|
+
def initialize(json)
|
7
|
+
@json = json
|
8
|
+
end
|
9
|
+
|
10
|
+
def url
|
11
|
+
@json['url']
|
12
|
+
end
|
13
|
+
|
14
|
+
def deploy_username
|
15
|
+
@json['deploy_username']
|
16
|
+
end
|
17
|
+
|
18
|
+
def deploy_password
|
19
|
+
@json['deploy_password']
|
20
|
+
end
|
21
|
+
|
22
|
+
def dir
|
23
|
+
@json['dir']
|
24
|
+
end
|
25
|
+
|
26
|
+
def current?
|
27
|
+
@json['current']
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def default_stage
|
32
|
+
@data['default_stage'] || 'development'
|
33
|
+
end
|
34
|
+
|
35
|
+
def initialize(file)
|
36
|
+
@file = file
|
37
|
+
@data = JSON.parse(File.read(file))
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.load(file)
|
41
|
+
Eh::Settings.new(file)
|
42
|
+
end
|
43
|
+
|
44
|
+
def write
|
45
|
+
File.open(file,"w") do |f|
|
46
|
+
f.write(data.to_json)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.current=(value)
|
51
|
+
Thread.current[:eh_settings] = value
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.current
|
55
|
+
Thread.current[:eh_settings]
|
56
|
+
end
|
57
|
+
|
58
|
+
def repository
|
59
|
+
repositories.find do |repository|
|
60
|
+
repository.current?
|
61
|
+
end if repositories
|
62
|
+
end
|
63
|
+
|
64
|
+
def repositories
|
65
|
+
repos = data["repositories"].map do |json|
|
66
|
+
Eh::Settings::Repository.new(json)
|
67
|
+
end if data["repositories"]
|
68
|
+
repos || []
|
69
|
+
end
|
70
|
+
|
71
|
+
def releases_dir(*extra_paths)
|
72
|
+
File.join(repository.dir, 'releases', *extra_paths)
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
def rails_release_dir
|
77
|
+
releases_dir('rails')
|
78
|
+
end
|
79
|
+
|
80
|
+
def ruby_release_dir
|
81
|
+
releases_dir('ruby')
|
82
|
+
end
|
83
|
+
|
84
|
+
def processors_src_dir
|
85
|
+
File.join(repository.dir, 'src', 'ruby')
|
86
|
+
end
|
87
|
+
|
88
|
+
def rails_src_dir
|
89
|
+
File.join(repository.dir, 'src', 'rails')
|
90
|
+
end
|
91
|
+
|
92
|
+
def console_source_dir
|
93
|
+
File.join(repository.dir, 'src', 'rails', 'console')
|
94
|
+
end
|
95
|
+
|
96
|
+
def deployment_dir
|
97
|
+
File.join(repository.dir, 'src', 'deployment')
|
98
|
+
end
|
99
|
+
|
100
|
+
def rails_src_dir
|
101
|
+
File.join(repository.dir, 'src', 'rails', 'console')
|
102
|
+
end
|
103
|
+
|
104
|
+
def source_config_dir
|
105
|
+
File.join(repository.dir, 'config')
|
106
|
+
end
|
107
|
+
|
108
|
+
def processor_template_repository_url
|
109
|
+
'https://github.com/thomis/eventhub-processor-template.git'
|
110
|
+
end
|
111
|
+
|
112
|
+
def package_tmp_dir
|
113
|
+
'./tmp'
|
114
|
+
end
|
115
|
+
|
116
|
+
def template_tmp_dir
|
117
|
+
'/tmp/eventhub-processor-template/'
|
118
|
+
end
|
119
|
+
|
120
|
+
def deployment_management_files
|
121
|
+
[File.join(deployment_dir, 'management', 'launcher.rb')]
|
122
|
+
end
|
123
|
+
|
124
|
+
def stages_dir
|
125
|
+
File.join(repository.dir, 'config', 'stages')
|
126
|
+
end
|
127
|
+
|
128
|
+
def db_backups_dir
|
129
|
+
File.expand_path('~/backups')
|
130
|
+
end
|
131
|
+
end
|
data/lib/eh/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module Eh
|
2
|
-
VERSION = '0.3.
|
3
|
-
end
|
1
|
+
module Eh
|
2
|
+
VERSION = '0.3.12'
|
3
|
+
end
|
data/lib/eh-commands.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
# All commands are required here
|
2
|
-
if Eh::Settings.current.repository
|
3
|
-
require 'eh/commands/generate_processor'
|
4
|
-
require 'eh/commands/package_ruby'
|
5
|
-
require 'eh/commands/package_rails'
|
6
|
-
require 'eh/commands/stage'
|
7
|
-
require 'eh/commands/deploy_config'
|
8
|
-
require 'eh/commands/deploy_ruby'
|
9
|
-
require 'eh/commands/deploy_mule'
|
10
|
-
require 'eh/commands/deploy_console'
|
11
|
-
require 'eh/commands/dump'
|
12
|
-
require 'eh/commands/db'
|
13
|
-
else
|
14
|
-
# remove unused settings for this version
|
15
|
-
Eh::Settings.current.data.delete('repository_root_dir')
|
16
|
-
Eh::Settings.current.write
|
17
|
-
puts "No current repository found."
|
18
|
-
puts "You can configure other repositories by running 'eh repository add' and/or 'eh repository select'"
|
19
|
-
end
|
20
|
-
|
21
|
-
require 'eh/commands/repository'
|
1
|
+
# All commands are required here
|
2
|
+
if Eh::Settings.current.repository
|
3
|
+
require 'eh/commands/generate_processor'
|
4
|
+
require 'eh/commands/package_ruby'
|
5
|
+
require 'eh/commands/package_rails'
|
6
|
+
require 'eh/commands/stage'
|
7
|
+
require 'eh/commands/deploy_config'
|
8
|
+
require 'eh/commands/deploy_ruby'
|
9
|
+
require 'eh/commands/deploy_mule'
|
10
|
+
require 'eh/commands/deploy_console'
|
11
|
+
require 'eh/commands/dump'
|
12
|
+
require 'eh/commands/db'
|
13
|
+
else
|
14
|
+
# remove unused settings for this version
|
15
|
+
Eh::Settings.current.data.delete('repository_root_dir')
|
16
|
+
Eh::Settings.current.write
|
17
|
+
puts "No current repository found."
|
18
|
+
puts "You can configure other repositories by running 'eh repository add' and/or 'eh repository select'"
|
19
|
+
end
|
20
|
+
|
21
|
+
require 'eh/commands/repository'
|
data/lib/eh.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
module Eh
|
2
|
-
end
|
3
|
-
|
4
|
-
require 'zip'
|
5
|
-
require 'pathname'
|
6
|
-
|
7
|
-
require 'eh/version'
|
8
|
-
require 'eh/settings'
|
9
|
-
require 'yaml'
|
10
|
-
|
11
|
-
require_relative 'deployer'
|
1
|
+
module Eh
|
2
|
+
end
|
3
|
+
|
4
|
+
require 'zip'
|
5
|
+
require 'pathname'
|
6
|
+
|
7
|
+
require 'eh/version'
|
8
|
+
require 'eh/settings'
|
9
|
+
require 'yaml'
|
10
|
+
|
11
|
+
require_relative 'deployer'
|
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.3.
|
4
|
+
version: 0.3.12
|
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-
|
12
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -195,9 +195,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
195
|
version: '0'
|
196
196
|
requirements: []
|
197
197
|
rubyforge_project:
|
198
|
-
rubygems_version: 2.
|
198
|
+
rubygems_version: 2.2.2
|
199
199
|
signing_key:
|
200
200
|
specification_version: 4
|
201
201
|
summary: Event Hub Command Line Tool
|
202
202
|
test_files: []
|
203
|
-
has_rdoc: true
|