Skip to content
Permalink
Browse files

Merge pull request #40 from winebarrel/v0.5.5

v0.5.5
  • Loading branch information...
I left from github. probably
I left from github. probably committed Mar 7, 2015
2 parents 7cfc2dc + b02966d commit 176505e2b4ced7875eab08894e3c0bcd90f2bb70
Showing with 12 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +3 −2 README.md
  3. +5 −1 bin/kumogata
  4. +2 −0 lib/kumogata/argument_parser.rb
  5. +1 −1 lib/kumogata/version.rb
@@ -19,3 +19,4 @@ packer_cache
test.rb
result.json
command_result.json
/_site
@@ -93,6 +93,7 @@ Options:
-r, --region REGION
--profile CONFIG_PROFILE
--credentials-path PATH
--config-path PATH
--format TMPLATE_FORMAT
--output-format FORMAT
--skip-replace-underscore
@@ -199,7 +200,7 @@ end

```ruby
Resources do
_include 'template2.rb'
_include 'template2.rb', :ami_id => 'ami-XXXXXXXX'
end
```

@@ -209,7 +210,7 @@ end
myEC2Instance do
Type "AWS::EC2::Instance"
Properties do
ImageId "ami-XXXXXXXX"
ImageId args[:ami_id]
InstanceType { Ref "InstanceType" }
KeyName "your_key_name"
end
@@ -29,8 +29,12 @@ begin

provider = AWS::Core::CredentialProviders::SharedCredentialFileProvider.new(credentials_opts)
aws_opts[:credential_provider] = provider
end

region = provider.send(:load_profile)['region']
if File.exist?(options.config_path) and File.readable?(options.config_path)
ini = AWS::Core::IniParser.parse(File.read(options.config_path))
profile = options.config_profile || 'default'
region = ini[profile]['region']
aws_opts[:region] = region if region
end

@@ -8,6 +8,7 @@ class Kumogata::ArgumentParser
:command_result_log => File.join(Dir.pwd, 'command_result.json'),
:color => $stdout.tty?,
:debug => false,
:config_path => File.expand_path('~/.aws/config'),
}

COMMANDS = {
@@ -86,6 +87,7 @@ def parse!
opt.on('-r', '--region REGION') {|v| options[:region] = v }
opt.on('' , '--profile CONFIG_PROFILE') {|v| options[:config_profile] = v }
opt.on('' , '--credentials-path PATH') {|v| options[:credentials_path] = v }
opt.on('' , '--config-path PATH') {|v| options[:config_path] = v }
opt.on('' , '--format TMPLATE_FORMAT', supported_formats) {|v| options[:format] = v }
opt.on('' , '--output-format FORMAT', supported_formats) {|v| options[:output_format] = v }
opt.on('' , '--skip-replace-underscore') { options[:skip_replace_underscore] = false }
@@ -1,3 +1,3 @@
module Kumogata
VERSION = '0.5.4'
VERSION = '0.5.5'
end

0 comments on commit 176505e

Please sign in to comment.
You can’t perform that action at this time.