roark 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,12 @@
1
+ ## 0.2.1 (06/27/2013):
2
+
3
+ * Internal Updates.
4
+ * Exposing logging from AMI class.
5
+
1
6
  ## 0.2.0 (06/20/2013):
2
7
 
3
8
  * Adding --tag
4
- * Change Cloud Formation Template argument from -t to -c
9
+ * Change Cloud Formation Template argument from -t to -c
5
10
 
6
11
  ## 0.1.0 (06/18/2013):
7
12
 
data/README.md CHANGED
@@ -46,8 +46,8 @@ Create AMI
46
46
  -p 'Parameter2=value2' \
47
47
  -a '123456789012' \
48
48
  -a '123456789013' \
49
- -t 'ami_tag_1=val1' \
50
- -t 'ami_tag_2=val2' \
49
+ -t 'AMITag1=val1' \
50
+ -t 'AMITag2=val2'
51
51
 
52
52
  Destroy AMI
53
53
 
@@ -8,8 +8,8 @@ module Roark
8
8
  @ami_id = args[:ami_id]
9
9
  @name = args[:name]
10
10
 
11
- @region = @aws.region
12
- @logger = Roark.logger
11
+ @region = @aws.region
12
+ @logger = Roark.logger
13
13
  end
14
14
 
15
15
  def create_instance(args)
@@ -2,12 +2,11 @@ module Roark
2
2
  class AmiCreateWorkflow
3
3
 
4
4
  def initialize(args)
5
- @account_ids = args[:account_ids]
5
+ @account_ids = Array(args[:account_ids])
6
6
  @ami = args[:ami]
7
- @tags = args[:tags]
7
+ @tags = args.fetch :tags, {}
8
8
  @parameters = args[:parameters]
9
9
  @template = args[:template]
10
- @logger = Roark.logger
11
10
  end
12
11
 
13
12
  def execute
@@ -15,23 +15,23 @@ module Roark
15
15
  def create
16
16
  option_parser.parse!
17
17
 
18
- validate_required_options [:name, :template]
18
+ validate_required_options [:name, :cloud_formation_template]
19
19
 
20
20
  validate_account_ids_format
21
21
 
22
- unless File.exists? @options[:template]
23
- @logger.error "Template #{@options[:template]} does not exist."
22
+ unless File.exists? @options[:cloud_formation_template]
23
+ @logger.error "Template #{@options[:cloud_formation_template]} does not exist."
24
24
  exit 1
25
25
  end
26
26
 
27
- template = File.read @options[:template]
27
+ template = File.read @options[:cloud_formation_template]
28
28
 
29
29
  ami = Roark::Ami.new :aws => aws, :name => @options[:name]
30
30
 
31
31
  ami_create_workflow = Roark::AmiCreateWorkflow.new :account_ids => @options[:account_ids],
32
32
  :ami => ami,
33
33
  :tags => @options[:tags],
34
- :template => template,
34
+ :template => cloud_formation_template,
35
35
  :parameters => @options[:parameters]
36
36
  response = ami_create_workflow.execute
37
37
 
@@ -52,7 +52,7 @@ module Roark
52
52
  end
53
53
 
54
54
  opts.on("-c", "--cloud_formation_template [CLOUD_FORMATION_TEMPLATE]", "Path to Cloud Formation template") do |o|
55
- @options[:template] = o
55
+ @options[:cloud_formation_template] = o
56
56
  end
57
57
 
58
58
  opts.on("-n", "--name [NAME]", "Name of AMI") do |o|
@@ -1,3 +1,3 @@
1
1
  module Roark
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["brett@weav.net"]
11
11
  spec.description = %q{Library and CLI to build AMIs from Instances created via Cloud Formation.}
12
12
  spec.summary = %q{Howard Roark, master architect and builder of AMIs.}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/intuit/roark"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec"
24
24
 
25
- spec.add_runtime_dependency "aws-sdk", "1.11.2"
25
+ spec.add_runtime_dependency "aws-sdk", "~> 1.11.2"
26
26
  end
@@ -6,7 +6,7 @@ describe Roark::AmiCreateWorkflow do
6
6
  @response_stub = mock 'response'
7
7
  Roark.logger logger_stub
8
8
  Roark.logger.stub :info => true
9
- @ami_mock = mock 'ami mock'
9
+ @ami_mock = mock 'ami mock'
10
10
  @account_ids = ['123456789012', '123456789013']
11
11
  @tags = { 'tag1' => 'val1', 'tag2' => 'val2' }
12
12
  @ami_create_workflow = Roark::AmiCreateWorkflow.new :account_ids => @account_ids,
@@ -37,4 +37,13 @@ describe Roark::AmiCreateWorkflow do
37
37
  :template => 'template').and_return @response_stub
38
38
  expect(@ami_create_workflow.execute.success?).to be_false
39
39
  end
40
+
41
+ it "should set the tags and accounts to empty if not set" do
42
+ @ami_create_workflow = Roark::AmiCreateWorkflow.new :ami => @ami_mock,
43
+ :parameters => { 'key' => 'val' },
44
+ :template => 'template'
45
+ expect(@ami_create_workflow.instance_variable_get(:@tags)).to eq({})
46
+ expect(@ami_create_workflow.instance_variable_get(:@account_ids)).to eq([])
47
+ end
48
+
40
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-20 00:00:00.000000000 Z
12
+ date: 2013-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &70360117909580 !ruby/object:Gem::Requirement
16
+ requirement: &70130675617320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.3'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70360117909580
24
+ version_requirements: *70130675617320
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70360117909160 !ruby/object:Gem::Requirement
27
+ requirement: &70130675615460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70360117909160
35
+ version_requirements: *70130675615460
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70360117908700 !ruby/object:Gem::Requirement
38
+ requirement: &70130675613960 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,18 +43,18 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70360117908700
46
+ version_requirements: *70130675613960
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: aws-sdk
49
- requirement: &70360117908200 !ruby/object:Gem::Requirement
49
+ requirement: &70130675612880 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
- - - =
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.11.2
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70360117908200
57
+ version_requirements: *70130675612880
58
58
  description: Library and CLI to build AMIs from Instances created via Cloud Formation.
59
59
  email:
60
60
  - brett@weav.net
@@ -113,7 +113,7 @@ files:
113
113
  - spec/response_spec.rb
114
114
  - spec/spec_helper.rb
115
115
  - spec/stack_spec.rb
116
- homepage: ''
116
+ homepage: https://github.com/intuit/roark
117
117
  licenses:
118
118
  - MIT
119
119
  post_install_message:
@@ -128,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  segments:
130
130
  - 0
131
- hash: -847601442206879501
131
+ hash: -2493666366236783940
132
132
  required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  none: false
134
134
  requirements:
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  segments:
139
139
  - 0
140
- hash: -847601442206879501
140
+ hash: -2493666366236783940
141
141
  requirements: []
142
142
  rubyforge_project:
143
143
  rubygems_version: 1.8.16