ec2launcher 1.0.33 → 1.0.34
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/config_loader.rb +30 -0
- data/lib/ec2launcher/config_wrapper.rb +28 -0
- data/lib/ec2launcher/version.rb +1 -1
- metadata +3 -1
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2012 Sean Laurent
|
3
|
+
#
|
4
|
+
require 'rubygems'
|
5
|
+
require 'log4r'
|
6
|
+
|
7
|
+
require 'ec2launcher/dsl/config'
|
8
|
+
|
9
|
+
include Log4r
|
10
|
+
|
11
|
+
module EC2Launcher
|
12
|
+
class ConfigLoader
|
13
|
+
attr_accessor :config
|
14
|
+
|
15
|
+
def initialize(base_directory)
|
16
|
+
@config = load_config_file(base_directory)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Read in the configuration file stored in the workspace directory.
|
20
|
+
# By default this will be './config.rb'.
|
21
|
+
#
|
22
|
+
# @return [EC2Launcher::Config] the parsed configuration object
|
23
|
+
def load_config_file(base_directory)
|
24
|
+
# Load configuration file
|
25
|
+
config_filename = File.join(base_directory, "config.rb")
|
26
|
+
abort("Unable to find 'config.rb' in '#{base_directory}'") unless File.exists?(config_filename)
|
27
|
+
EC2Launcher::DSL::ConfigDSL.execute(File.read(config_filename)).config
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2012 Sean Laurent
|
3
|
+
#
|
4
|
+
require 'rubygems'
|
5
|
+
|
6
|
+
require 'ec2launcher/config_loader'
|
7
|
+
require 'ec2launcher/environment_processor'
|
8
|
+
require 'ec2launcher/application_processor'
|
9
|
+
|
10
|
+
module EC2Launcher
|
11
|
+
class ConfigWrapper
|
12
|
+
attr_accessor :config
|
13
|
+
attr_accessor :applications
|
14
|
+
attr_accessor :environments
|
15
|
+
|
16
|
+
def initialize(base_directory)
|
17
|
+
# Load configuration data
|
18
|
+
config_loader = ConfigLoader.new(base_directory)
|
19
|
+
@config = config_loader.config
|
20
|
+
|
21
|
+
env_processor = EnvironmentProcessor.new(base_directory, @config.environments)
|
22
|
+
app_processor = ApplicationProcessor.new(base_directory, @config.applications)
|
23
|
+
|
24
|
+
@environments = env_processor.environments
|
25
|
+
@applications = app_processor.applications
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/ec2launcher/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ec2launcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.34
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -63,6 +63,8 @@ files:
|
|
63
63
|
- lib/ec2launcher/application_processor.rb
|
64
64
|
- lib/ec2launcher/backoff_runner.rb
|
65
65
|
- lib/ec2launcher/block_device_builder.rb
|
66
|
+
- lib/ec2launcher/config_loader.rb
|
67
|
+
- lib/ec2launcher/config_wrapper.rb
|
66
68
|
- lib/ec2launcher/defaults.rb
|
67
69
|
- lib/ec2launcher/directory_processing.rb
|
68
70
|
- lib/ec2launcher/dsl/application.rb
|