minimal_pipeline 0.0.21 → 0.1.0

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
  SHA256:
3
- metadata.gz: e66eb93b7279f55a905bcf93175b4a7e8913365c2c01226a6a4e529536a669aa
4
- data.tar.gz: 1d0be9124dafe273c01fbbeb402657db2e7e726337cd7ee357512a26813b6c1f
3
+ metadata.gz: ffb984c98ca6bbe57bfe8f08801869e44c3dfc7fca52d25497726ea39ba91d68
4
+ data.tar.gz: 4db5f2f7ff27711223742cc5b6e6d35a85854b2bfcf285b2113139f3e5ac902c
5
5
  SHA512:
6
- metadata.gz: bc652c291e35aaca7229c8cb86c5224543af81b340f3773933d52efe2924dd7632d4b4fd6a3053985cab6fec860060057d9a483e8676c97314eda42ac185ee5a
7
- data.tar.gz: cb304e49d60324e104dc99be3ff68a9f1f3c56033be6f12feaa1139a3f0bdcd55609eddf1214c06feb17cc8ef6aa53a8ce7cdc9bc5fb079f802b03a41218c02c
6
+ metadata.gz: 93af2bdadcdfdeec3b9b3f47ffc7694a5790710e365507c420a0f74448169d8aec1dff90cd75647d1885a8b1929e6eb834bfc36dbdbb7a9b733e2c188e8e1d87
7
+ data.tar.gz: b344ee7101cee0f5c99c90ecc538d7bb91582e713a525a59f688082c128cd3a1e51d75650e4c1836c19e072bfa613faf1b3987777d9708a7d9215f43be543172
@@ -8,21 +8,14 @@ class MinimalPipeline
8
8
  # ```
9
9
  # cloudformation = MinimalPipeline::Cloudformation.new
10
10
  #
11
- # cloudformation_parameters = {
11
+ # parameters = {
12
12
  # 'Vpc' => 'vpc-123456',
13
13
  # 'AsgSubnets' => %w[sg-one sg-two sg-three],
14
14
  # 'ElbSecurityGroup' => 'sg-123456',
15
15
  # 'CertName' => 'example'
16
16
  # }
17
17
  #
18
- # stack_parameters = {
19
- # stack_name: stack_name,
20
- # template_body: File.read('provisioning/elb.json'),
21
- # capabilities: ['CAPABILITY_IAM'],
22
- # parameters: cloudformation.params(cloudformation_parameters)
23
- # }
24
- #
25
- # cloudformation.deploy_stack('EXAMPLE_ELB', stack_parameters)
18
+ # cloudformation.deploy_stack('EXAMPLE_ELB', parameters, 'stack.yaml')
26
19
  # name = cloudformation.stack_output(stack_name, 'LoadBalancerName')
27
20
  # ```
28
21
  #
@@ -101,12 +94,20 @@ class MinimalPipeline
101
94
 
102
95
  # @param stack_name [String] The name of the CloudFormation stack
103
96
  # @param stack_parameters [Hash] Parameters to be passed into the stack
104
- def deploy_stack(stack_name, stack_parameters)
97
+ def deploy_stack(stack_name, parameters, template,
98
+ capabilities = ['CAPABILITY_IAM'])
105
99
  wait_options = {
106
100
  max_attempts: @wait_max_attempts,
107
101
  delay: @wait_delay
108
102
  }
109
103
 
104
+ stack_parameters = {
105
+ stack_name: stack_name,
106
+ template_body: File.read(template),
107
+ capabilities: capabilities,
108
+ parameters: params(parameters)
109
+ }
110
+
110
111
  unless @client.describe_stacks(stack_name: stack_name).stacks.empty?
111
112
  puts 'Updating the existing stack' if ENV['DEBUG']
112
113
  @client.update_stack(stack_parameters)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minimal_pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mayowa Aladeojebi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-26 00:00:00.000000000 Z
12
+ date: 2018-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk