stackit 0.1.11 → 0.1.13

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: 01dd010036a18e22f700a8cd74adbbb35528fb40
4
- data.tar.gz: d878a02071e96253c09791a3a5ff71c706324adc
3
+ metadata.gz: 37957a0ab7a75459eea8abaa2069aacf28cf4add
4
+ data.tar.gz: 516c9bd146cb7771de86751bd9aba7126582fcca
5
5
  SHA512:
6
- metadata.gz: 7b434450d3f80488c1f5fd0f0b1efed75757f8966746b224823efe0c7cf85cb07d2a3b2886b5e34345a4dc341762bb650bf8a97a0fffadd22864468fdb497ce5
7
- data.tar.gz: f718c76dfa0796510a8e0e1e58990deea81a242532352e18ec796a0c2a65a3cda4ff9e3cf05dbcb5d194679abe744767a8b7a817548da8b7986c4b93c10134a4
6
+ metadata.gz: 0fc16655e92b18cbc1ff896b90dd9587e42e07bd711aa7020976d8b816f3acee6b9dccf227f8d8fbf598a7250fa405806408f9dbb1e9f0ebd83d376eeedb4c1c
7
+ data.tar.gz: 9b51f7362a14c70c0901999588c3a1d715909a242e3da30beb4d382540ef2a72c180817613dce1b050ee0cd198daafb260466b5deb182961e243c619dc532e8a
@@ -164,7 +164,8 @@ module Stackit
164
164
  def create_template(t, action)
165
165
  template_path = t ? t : File.join(Dir.pwd, 'cloudformation', "#{stack_name.underscore.dasherize}.json")
166
166
  if !File.exist?(template_path)
167
- raise "Unable to locate template: #{template_path}" unless action == :delete_stack
167
+ return if action == :delete_stack
168
+ raise "Unable to locate template: #{template_path}"
168
169
  end
169
170
  template = Template.new(
170
171
  :cloudformation => cloudformation,
@@ -0,0 +1,71 @@
1
+ module Stackit
2
+
3
+ class ManagedStackService
4
+
5
+ attr_accessor :options
6
+
7
+ def initialize(options)
8
+ self.options = options
9
+ end
10
+
11
+ def create!
12
+ Stackit::ManagedStack.new(
13
+ template: template,
14
+ stack_name: stack_name,
15
+ stack_policy: options[:stack_policy],
16
+ depends: options[:depends],
17
+ parameters_file: parameters_file,
18
+ parameter_map: parameter_mappings,
19
+ wait: options[:wait],
20
+ force: options[:force],
21
+ dry_run: options[:dry_run],
22
+ debug: !!options[:debug]
23
+ ).create!
24
+ end
25
+
26
+ def update!
27
+ ManagedStack.new(
28
+ template: template,
29
+ stack_name: stack_name,
30
+ stack_policy: options[:stack_policy],
31
+ stack_policy_during_update: options[:stack_policy_during_update],
32
+ depends: options[:depends],
33
+ parameters_file: parameters_file,
34
+ parameter_map: parameter_mappings,
35
+ wait: options[:wait],
36
+ force: options[:force],
37
+ dry_run: options[:dry_run],
38
+ debug: !!options[:debug]
39
+ ).update!
40
+ end
41
+
42
+ def delete!
43
+ Stackit::ManagedStack.new(
44
+ stack_name: stack_name
45
+ ).delete!
46
+ end
47
+
48
+ protected
49
+
50
+ def stack_name
51
+ return options[:stack_name] || "#{Stackit.environment}-#{options[:stack_name]}"
52
+ end
53
+
54
+ def template
55
+ return options[:template] || File.expand_path("#{options[:stack_name]}.json", template_dir)
56
+ end
57
+
58
+ def parameters_file
59
+ return options[:parameters_file || File.expand_path("#{options[:stack_name]}.parameters", template_dir)
60
+ end
61
+
62
+ def parameter_mappings
63
+ {}
64
+ end
65
+
66
+ def template_dir
67
+ dir = options[:template_dir] ? options[:template_dir] : __dir__
68
+ end
69
+
70
+ end
71
+ end
@@ -1,3 +1,3 @@
1
1
  module Stackit
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.13"
3
3
  end
data/lib/stackit.rb CHANGED
@@ -10,6 +10,7 @@ require "stackit/template"
10
10
  require "stackit/stack/default_notifier"
11
11
  require "stackit/stack"
12
12
  require "stackit/stack/managed_stack"
13
+ require "stackit/stack/managed_stack_service"
13
14
 
14
15
  module Stackit
15
16
  class << self
data/stackit.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency "rspec", "~> 3.0"
32
32
  spec.add_development_dependency 'pry-byebug', '~> 2.0'
33
33
 
34
- spec.add_runtime_dependency 'awsclient'
34
+ spec.add_runtime_dependency 'awsclient', '~> 0'
35
35
  spec.add_runtime_dependency 'aws-sdk', '~> 2'
36
36
  spec.add_runtime_dependency 'thor', '~> 0.19'
37
37
  spec.add_runtime_dependency 'activesupport', '~> 4.2'
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.1.11
4
+ version: 0.1.13
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-04-27 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,14 +70,14 @@ dependencies:
70
70
  name: awsclient
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
@@ -149,6 +149,7 @@ files:
149
149
  - lib/stackit/stack/default-stack-policy.json
150
150
  - lib/stackit/stack/default_notifier.rb
151
151
  - lib/stackit/stack/managed_stack.rb
152
+ - lib/stackit/stack/managed_stack_service.rb
152
153
  - lib/stackit/template.rb
153
154
  - lib/stackit/version.rb
154
155
  - lib/stackit/wait.rb
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
181
  version: '0'
181
182
  requirements: []
182
183
  rubyforge_project:
183
- rubygems_version: 2.4.8
184
+ rubygems_version: 2.2.2
184
185
  signing_key:
185
186
  specification_version: 4
186
187
  summary: Simple, elegant CloudFormation dependency management.