stackit 0.3.15 → 0.3.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fea38d6528a20ee6ea0da53ee38b31ef62602632
4
- data.tar.gz: e1b1778d4a065608068ebe24ce2ed8c85e67695d
3
+ metadata.gz: 1ffff6b69e08f840f696705eeedbe74a30df0c1c
4
+ data.tar.gz: f6b64ee09b99d485d629fd6e7a005599a5d4eb1c
5
5
  SHA512:
6
- metadata.gz: 26e0444242600f55a7125d10577eee8d048dbd2813faf0c674b25f6189e82396eebcd91c890f758fb676e83a25585fcd1a341004b23c00744a63c7c630c4511b
7
- data.tar.gz: 15cc0a0dc3c11f3fea52ae7eae22b99f68efb85d0efe43b71e489bdb7861de1ea9c6fe4c54cffa304750c0bfa5a9b9b6ec31d796ebb42b84bbc6d7ebd12c5f3c
6
+ metadata.gz: 6e17e416d5f09fc8e273d05fb770123a63d5516580b0f910c827e6a65d5de0b58920af9214c8666a5d1decd1cc5a34a66a8602a8140a0550d2e96ae4110837ef
7
+ data.tar.gz: 6eb7ee1e76f486a286841c0eed374d4cc49d2445c0e35ee900bee79a0e1c939907f9d3a5a8f2bbd9f9422445927613a06519c4f800f600b6a835f887bbf2a06b
@@ -5,8 +5,8 @@ module Stackit
5
5
  class BaseCli < Thor
6
6
 
7
7
  class_option :environment, :aliases => '-e', :desc => "Your stack environment (dev, staging, prod, etc)", :default => 'default'
8
- class_option :profile, desc: 'AWS profile'
9
- class_option :region, desc: 'AWS region', default: 'us-east-1'
8
+ class_option :profile, desc: 'AWS profile', :default => 'default'
9
+ class_option :region, desc: 'AWS region'
10
10
  class_option :debug, type: :boolean, default: false
11
11
  class_option :verbose, type: :boolean, default: false
12
12
  class_option :assume_role, type: :hash, :desc => 'IAM role name and optional duration to keep the STS token valid'
@@ -31,31 +31,37 @@ module Stackit
31
31
  no_commands do
32
32
 
33
33
  def init_cli
34
- Stackit.aws.region = options[:region] if options[:region]
35
- Stackit.environment = options[:environment].to_sym if options[:environment]
36
34
  Stackit.debug = !!options[:debug]
35
+ Stackit.environment = options[:environment].to_sym
36
+
37
37
  if Stackit.debug
38
38
  Stackit.logger.level = Logger::DEBUG
39
- Stackit.logger.debug "Initializing CLI in debug mode."
39
+ Stackit.logger.debug "Initializing CLI in DEBUG mode!"
40
40
  begin
41
41
  require 'pry-byebug'
42
42
  rescue LoadError; end
43
43
  elsif options[:verbose]
44
44
  Stackit.logger.level = Logger::INFO
45
+ Stackit.logger.debug "Initializing CLI with INFO logging level"
45
46
  else
46
47
  Stackit.logger.level = Logger::ERROR
47
48
  end
48
- if options[:profile]
49
- Stackit.aws.profile = options[:profile]
50
- elsif options[:environment]
51
- Stackit.aws.credentials = Stackit.aws.load_credentials(
52
- options[:environment]
53
- )
54
- end
49
+
50
+ Stackit.logger.debug "Environment: #{Stackit.environment}"
51
+
52
+ Stackit.aws.credentials = Stackit.aws.load_credentials(options[:environment])
53
+
54
+ Stackit.aws.profile = options[:profile] if options[:profile]
55
+ Stackit.logger.debug "Profile: #{Stackit.aws.profile}"
56
+
57
+ Stackit.aws.region = options[:region] if options[:region]
58
+ Stackit.logger.debug "Region: #{Stackit.aws.region}"
59
+
55
60
  if options[:assume_role] && options[:assume_role].has_key?('name')
56
61
  name = options[:assume_role]['name']
57
62
  duration = options[:assume_role].has_key?('duration') ? options[:assume_role]['duration'] : 3600
58
63
  Stackit.aws.assume_role!(name, duration)
64
+ Stackit.logger.debug "Assumed Role: #{name}"
59
65
  end
60
66
  end
61
67
 
@@ -50,6 +50,12 @@ module Stackit
50
50
  options[:depends]
51
51
  end
52
52
 
53
+ def depends_on(deps)
54
+ if options[:depends] && options[:depends].empty?
55
+ options[:depends] = deps
56
+ end
57
+ end
58
+
53
59
  def parameter_mappings
54
60
  {}
55
61
  end
@@ -1,3 +1,3 @@
1
1
  module Stackit
2
- VERSION = "0.3.15"
2
+ VERSION = "0.3.16"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.15
4
+ version: 0.3.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Hahn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler