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.
- checksums.yaml +4 -4
- data/lib/minimal_pipeline/ec2.rb +18 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49a87ec154c00b5b3cc78a85712fedd461c078b99da4a017f80b1e980630a65b
|
4
|
+
data.tar.gz: b7157df87c3d88976d65301577db4ed8d7c3604496a2670ab64bcd593aa272fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b83d3990033606553b6bb0d4e8024587e576d19f7ada8cc123eb36f6f73c02836adbdd2d3c9c489401c7fd483f7177d39bb13e7181ad1d2e8f0d8e228375581e
|
7
|
+
data.tar.gz: 63e2fa417e5b5d7c951b9fd2062dfb30aa46d7f59e25aeca2e34f89db1257cf04178ab428f4fd860f199cbe3fa8d45c2b61d38336186a2447aec429e82209038
|
data/lib/minimal_pipeline/ec2.rb
CHANGED
@@ -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
|
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
|