capify-ec2 1.1.14.pre.1 → 1.1.14
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.
- data/Changelog.md +1 -0
- data/lib/capify-ec2.rb +1 -3
- data/lib/capify-ec2/capistrano.rb +17 -5
- data/lib/capify-ec2/version.rb +1 -1
- metadata +8 -12
data/Changelog.md
CHANGED
data/lib/capify-ec2.rb
CHANGED
@@ -12,9 +12,7 @@ class CapifyEc2
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.determine_regions(region = nil)
|
15
|
-
|
16
|
-
regions = [region] if region
|
17
|
-
regions
|
15
|
+
region.nil? ? (ec2_config[:aws_params][:regions] || [ec2_config[:aws_params][:region]]) : region
|
18
16
|
end
|
19
17
|
|
20
18
|
def self.running_instances(region = nil)
|
@@ -55,6 +55,8 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
55
55
|
server_name = variables[:logger].instance_variable_get("@options")[:actions].first unless variables[:logger].instance_variable_get("@options")[:actions][1].nil?
|
56
56
|
named_instance = CapifyEc2.get_instance_by_name(server_name)
|
57
57
|
task named_instance.name.to_sym do
|
58
|
+
remove_default_roles
|
59
|
+
server_address = named_instance.dns_name
|
58
60
|
named_instance.roles.each do |role|
|
59
61
|
define_role({:name => role, :options => {}}, named_instance)
|
60
62
|
end
|
@@ -64,25 +66,28 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
64
66
|
|
65
67
|
def ec2_role(role_name_or_hash)
|
66
68
|
role = role_name_or_hash.is_a?(Hash) ? role_name_or_hash : {:name => role_name_or_hash,:options => {}}
|
69
|
+
|
67
70
|
instances = CapifyEc2.get_instances_by_role(role[:name])
|
68
71
|
if role[:options].delete(:default)
|
69
72
|
instances.each do |instance|
|
70
73
|
define_role(role, instance)
|
71
74
|
end
|
72
|
-
end
|
73
|
-
|
74
|
-
|
75
|
+
end
|
76
|
+
|
75
77
|
regions = CapifyEc2.ec2_config[:aws_params][:regions] || [CapifyEc2.ec2_config[:aws_params][:region]]
|
76
78
|
regions.each do |region|
|
77
79
|
define_regions(region, role)
|
78
80
|
end unless regions.nil?
|
79
|
-
|
81
|
+
|
82
|
+
define_role_roles(role, instances)
|
80
83
|
define_instance_roles(role, instances)
|
84
|
+
|
81
85
|
end
|
82
86
|
|
83
87
|
def define_regions(region, role)
|
84
88
|
instances = CapifyEc2.get_instances_by_region(role[:name], region)
|
85
|
-
task region.to_sym do
|
89
|
+
task region.to_sym do
|
90
|
+
remove_default_roles
|
86
91
|
instances.each do |instance|
|
87
92
|
define_role(role, instance)
|
88
93
|
end
|
@@ -92,6 +97,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
92
97
|
def define_instance_roles(role, instances)
|
93
98
|
instances.each do |instance|
|
94
99
|
task instance.name.to_sym do
|
100
|
+
remove_default_roles
|
95
101
|
define_role(role, instance)
|
96
102
|
end
|
97
103
|
end
|
@@ -99,6 +105,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
99
105
|
|
100
106
|
def define_role_roles(role, instances)
|
101
107
|
task role[:name].to_sym do
|
108
|
+
remove_default_roles
|
102
109
|
instances.each do |instance|
|
103
110
|
define_role(role, instance)
|
104
111
|
end
|
@@ -120,4 +127,9 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
120
127
|
def numeric?(object)
|
121
128
|
true if Float(object) rescue false
|
122
129
|
end
|
130
|
+
|
131
|
+
def remove_default_roles
|
132
|
+
roles.reject! { true }
|
133
|
+
end
|
134
|
+
|
123
135
|
end
|
data/lib/capify-ec2/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capify-ec2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
9
|
- 14
|
10
|
-
|
11
|
-
- 1
|
12
|
-
version: 1.1.14.pre.1
|
10
|
+
version: 1.1.14
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Noah Cantor
|
@@ -18,7 +16,7 @@ autorequire:
|
|
18
16
|
bindir: bin
|
19
17
|
cert_chain: []
|
20
18
|
|
21
|
-
date: 2011-
|
19
|
+
date: 2011-09-01 00:00:00 +01:00
|
22
20
|
default_executable:
|
23
21
|
dependencies:
|
24
22
|
- !ruby/object:Gem::Dependency
|
@@ -110,14 +108,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
109
|
none: false
|
112
110
|
requirements:
|
113
|
-
- - "
|
111
|
+
- - ">="
|
114
112
|
- !ruby/object:Gem::Version
|
115
|
-
hash:
|
113
|
+
hash: 3
|
116
114
|
segments:
|
117
|
-
-
|
118
|
-
|
119
|
-
- 1
|
120
|
-
version: 1.3.1
|
115
|
+
- 0
|
116
|
+
version: "0"
|
121
117
|
requirements: []
|
122
118
|
|
123
119
|
rubyforge_project: capify-ec2
|