opzworks 0.12.2 → 0.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/circle.yml +3 -0
- data/lib/opzworks/commands/berks.rb +36 -0
- data/lib/opzworks/meta.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e967928f87239b584f45d8af269bd48662b80171
|
4
|
+
data.tar.gz: 40f04139f1ef3457f1a8f027f71712b87c2539fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25dd95265c036d91cc21b283a673b706c91a52afa500a3410a82f76a48bb48cf903a39b11a89ce113968134a2a8fd13a658d72002e9a63342f52de522423b2f5
|
7
|
+
data.tar.gz: 586bb8b49770c926c06eecdb15113b41266f0725896b86350167f4565287b38bbd83522b01e793067c72c66d533d8e4698d7be561950dda11865f8bf58094935
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/circle.yml
CHANGED
@@ -137,6 +137,42 @@ module OpzWorks
|
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
|
+
begin
|
141
|
+
cull = s3_client.list_objects(
|
142
|
+
bucket: s3_bucket,
|
143
|
+
prefix: "#{@s3_path}/#{cookbook_tarball}-"
|
144
|
+
)
|
145
|
+
rescue Aws::S3::Errors::ServiceError => e
|
146
|
+
puts "Caught exception trying to list backups in #{s3_bucket}:".foreground(:red)
|
147
|
+
puts "\t#{e}"
|
148
|
+
else
|
149
|
+
backup_arr = []
|
150
|
+
cull.contents.each { |k,v| backup_arr << k.key }
|
151
|
+
backup_arr.pop(5) # keep last 5 backups
|
152
|
+
|
153
|
+
if backup_arr.length != 0
|
154
|
+
delete_arr = []
|
155
|
+
while backup_arr.length > 0
|
156
|
+
puts "Adding backup #{backup_arr[0]} to the cull list".foreground(:green)
|
157
|
+
delete_arr << backup_arr.pop
|
158
|
+
|
159
|
+
arr_of_hash = []
|
160
|
+
delete_arr.each { |i| arr_of_hash << { 'key': i } }
|
161
|
+
|
162
|
+
puts 'Culling old backups'.foreground(:green)
|
163
|
+
begin
|
164
|
+
s3_client.delete_objects(
|
165
|
+
bucket: s3_bucket,
|
166
|
+
delete: { objects: arr_of_hash }
|
167
|
+
)
|
168
|
+
rescue Aws::S3::Errors::ServiceError => e
|
169
|
+
puts "Caught exception trying to delete backups in #{s3_bucket}:".foreground(:red)
|
170
|
+
puts "\t#{e}"
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
140
176
|
# upload
|
141
177
|
puts "\nUploading to S3".foreground(:blue)
|
142
178
|
begin
|
data/lib/opzworks/meta.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opzworks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grant Heffernan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-04-
|
12
|
+
date: 2016-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|