ec2launcher 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/ec2launcher/environment.rb +3 -2
- data/lib/ec2launcher/version.rb +1 -1
- data/lib/ec2launcher.rb +5 -24
- metadata +1 -1
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 1.0.9
|
2
|
+
|
3
|
+
* Remove "default" environment.
|
4
|
+
|
1
5
|
## 1.0.8
|
2
6
|
|
3
7
|
* Create instance with security group ids, instead of security group names. Fixes problem when launching an instance into a VPC with a security group that exists with the same name in the public cloud and in the vpc.
|
@@ -202,15 +202,16 @@ module EC2Launcher
|
|
202
202
|
|
203
203
|
@aliases = other_env.aliases.nil? ? nil : other_env.aliases
|
204
204
|
|
205
|
+
@ami_name = other_env.ami_name unless other_env.ami_name.nil?
|
205
206
|
@aws_keyfile = other_env.aws_keyfile unless other_env.aws_keyfile.nil?
|
206
207
|
@availability_zone = other_env.availability_zone unless other_env.availability_zone.nil?
|
207
208
|
@chef_server_url = other_env.chef_server_url unless other_env.chef_server_url.nil?
|
208
209
|
@chef_validation_pem_url = other_env.chef_validation_pem_url unless other_env.chef_validation_pem_url.nil?
|
209
|
-
@domain_name = other_env.domain_name unless other_env.domain_name
|
210
|
+
@domain_name = other_env.domain_name unless other_env.domain_name.nil?
|
210
211
|
@email_notifications = other_env.email_notifications unless other_env.email_notifications.nil?
|
211
212
|
@key_name = other_env.key_name unless other_env.key_name.nil?
|
212
213
|
@subnet = other_env.subnet unless other_env.subnet.nil?
|
213
|
-
@
|
214
|
+
@short_name = other_env.short_name unless other_env.short_name.nil?
|
214
215
|
end
|
215
216
|
|
216
217
|
def load(dsl)
|
data/lib/ec2launcher/version.rb
CHANGED
data/lib/ec2launcher.rb
CHANGED
@@ -57,28 +57,14 @@ module EC2Launcher
|
|
57
57
|
environments_directories = process_directory_list(@config.environments, "environments", "Environments", false)
|
58
58
|
applications_directories = process_directory_list(@config.applications, "applications", "Applications", true)
|
59
59
|
|
60
|
-
# Attempt to load default environment data
|
61
|
-
@default_environment = nil
|
62
|
-
environments_directories.each do |env_dir|
|
63
|
-
filename = File.join(env_dir, "default.rb")
|
64
|
-
@default_environment = load_environment_file(filename)
|
65
|
-
unless @default_environment.nil?
|
66
|
-
validate_environment(filename, @default_environment)
|
67
|
-
break
|
68
|
-
end
|
69
|
-
end
|
70
|
-
@default_environment ||= EC2Launcher::Environment.new
|
71
|
-
@default_environment.inherit(nil)
|
72
|
-
|
73
60
|
# Load other environments
|
74
61
|
@environments = { }
|
75
62
|
environments_directories.each do |env_dir|
|
76
63
|
Dir.entries(env_dir).each do |env_name|
|
77
64
|
filename = File.join(env_dir, env_name)
|
78
65
|
next if File.directory?(filename)
|
79
|
-
next if filename == "default.rb"
|
80
66
|
|
81
|
-
new_env = load_environment_file(filename
|
67
|
+
new_env = load_environment_file(filename)
|
82
68
|
validate_environment(filename, new_env)
|
83
69
|
|
84
70
|
@environments[new_env.name] = new_env
|
@@ -167,7 +153,6 @@ module EC2Launcher
|
|
167
153
|
if availability_zone.nil?
|
168
154
|
availability_zone = @application.availability_zone
|
169
155
|
availability_zone ||= @environment.availability_zone
|
170
|
-
availability_zone ||= @default_environment.availability_zone
|
171
156
|
availability_zone ||= "us-east-1a"
|
172
157
|
end
|
173
158
|
|
@@ -175,7 +160,6 @@ module EC2Launcher
|
|
175
160
|
# SSH KEY
|
176
161
|
##############################
|
177
162
|
key_name = @environment.key_name
|
178
|
-
key_name ||= @default_environment.key_name
|
179
163
|
if key_name.nil?
|
180
164
|
puts "Unable to determine SSH key name."
|
181
165
|
exit 4
|
@@ -701,7 +685,7 @@ rm -f /tmp/runurl"
|
|
701
685
|
#
|
702
686
|
# @return [EC2Launcher::Environment] the new environment loaded from the specified file.
|
703
687
|
#
|
704
|
-
def load_environment_file(name,
|
688
|
+
def load_environment_file(name, fail_on_missing = false)
|
705
689
|
unless File.exists?(name)
|
706
690
|
abort("Unable to read environment: #{name}") if fail_on_missing
|
707
691
|
return nil
|
@@ -761,13 +745,10 @@ rm -f /tmp/runurl"
|
|
761
745
|
end
|
762
746
|
|
763
747
|
def process_environment_inheritance(env)
|
748
|
+
return env if env.inherit.nil?
|
749
|
+
|
764
750
|
# Find base environment
|
765
|
-
base_env =
|
766
|
-
if env.inherit.nil?
|
767
|
-
base_env = @default_environment
|
768
|
-
else
|
769
|
-
base_env = @environments[env.inherit]
|
770
|
-
end
|
751
|
+
base_env = @environments[env.inherit]
|
771
752
|
abort("Invalid inheritance '#{env.inherit}' in #{env.name}") if base_env.nil?
|
772
753
|
|
773
754
|
new_env = nil
|