minimal_pipeline 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/minimal_pipeline/ec2.rb +18 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c316c13124256c9ddc3648899fd7559e62cdd83b483b6159b67de99bb6f0da8
4
- data.tar.gz: aa5982e41abb24842f53f3811392a80eec2435004687a745331b6cf1af1a91f6
3
+ metadata.gz: 49a87ec154c00b5b3cc78a85712fedd461c078b99da4a017f80b1e980630a65b
4
+ data.tar.gz: b7157df87c3d88976d65301577db4ed8d7c3604496a2670ab64bcd593aa272fe
5
5
  SHA512:
6
- metadata.gz: 14759d8823ae03e8af3aa6925a2467fa445dfa5b25bdc170256f77fe4884144c272adf4893942e9e185b3ce4946aac22a5188bbec2ee437f0a92be4041169d61
7
- data.tar.gz: 808324bdb17014eb5e8265ea2ade6231afadb3cec9ae86577f936301fc80a6f94d36322e0d8b335c62e0064dc710dd31cf2eed73af0e532e9e642f8d8cb4dda8
6
+ metadata.gz: b83d3990033606553b6bb0d4e8024587e576d19f7ada8cc123eb36f6f73c02836adbdd2d3c9c489401c7fd483f7177d39bb13e7181ad1d2e8f0d8e228375581e
7
+ data.tar.gz: 63e2fa417e5b5d7c951b9fd2062dfb30aa46d7f59e25aeca2e34f89db1257cf04178ab428f4fd860f199cbe3fa8d45c2b61d38336186a2447aec429e82209038
@@ -24,13 +24,13 @@ class MinimalPipeline
24
24
  @client = Aws::EC2::Client.new(region: 'us-east-1')
25
25
  end
26
26
 
27
- # Block processing until snapshot until new snapshot is ready
27
+ # Block processing until new snapshot is ready
28
28
  #
29
29
  # @param snapshot_id [String] The ID of the new snapshot
30
30
  def wait_for_snapshot(snapshot_id)
31
31
  puts "waiting on new snapshot #{snapshot_id} to be ready"
32
32
  @client.wait_until(:snapshot_completed, snapshot_ids: [snapshot_id])
33
- puts "New snapshot #{snapshot_id}is ready"
33
+ puts "New snapshot #{snapshot_id} is ready"
34
34
  rescue Aws::Waiters::Errors::WaiterFailed => error
35
35
  puts "failed waiting for snapshot to be ready: #{error.message}"
36
36
  end
@@ -151,7 +151,22 @@ class MinimalPipeline
151
151
  params['kms_key_id'] = kms_key_id if kms_key_id
152
152
 
153
153
  response = @client.copy_image(params)
154
- response.image_id
154
+ new_image_id = response.image_id
155
+
156
+ wait_for_image(new_image_id)
157
+
158
+ new_image_id
155
159
  end
156
160
  end
161
+
162
+ # Block processing until new image is ready
163
+ #
164
+ # @param image_id [String] The ID of the new image
165
+ def wait_for_image(image_id)
166
+ puts "waiting on new image #{image_id} to be available"
167
+ @client.wait_until(:image_available, image_ids: [image_id])
168
+ puts "New image #{image_id} is available"
169
+ rescue Aws::Waiters::Errors::WaiterFailed => error
170
+ puts "failed waiting for image to be available: #{error.message}"
171
+ end
157
172
  end
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.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mayowa Aladeojebi