aws-ec2 1.3.0 → 1.3.1

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: b609d157c4ac6348d6fa370a17549c95987d2637060a34f84da9ad3dd303df80
4
- data.tar.gz: d6c436bca85ddac006a853f6a6fe3bdc6cb848dc524b2e913912069047755e89
3
+ metadata.gz: 25ed3f964ac1b46d2ba36889dea2d02b6196bbc0a2aeb455528873e3103b255c
4
+ data.tar.gz: acbb597967043091532f4d44aa78a22202ee09080b351a43e3e12f855f70117b
5
5
  SHA512:
6
- metadata.gz: 410535c2bda5df7ab1d97bcc015158be003fa41cf41dda9c2ff5c97aa78f493a4c7eeb38080eaf3c93b14bb64344708adff7422eda516c6f987da38ff0842434
7
- data.tar.gz: 44fc0c559ad6565742c66c0022097c93509bf6aad785b912d506cf75bf6d0bf728fe423555678c33cc7135cef3613369e7a828cc160baf0a86d69f8da8ac084d
6
+ metadata.gz: 16683a497d46c764ab49f69738da3e755431fa9c5c4b95c1efee249621fd40ab3c51bf2c848168674273f4597e11e2e7f606ab543ad041b2e31fe9fcbf9b4229
7
+ data.tar.gz: 28177138d601571e7a76a0c708190b76b9a3f9193b12fd0fb069641cfa800bdd68a63ce35183b415c36771217cdb8b3f230819663120374aae8dd982b2ea9198
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.3.1]
7
+ - fix cleaning so it cleans out the oldest images
8
+
6
9
  ## [1.3.0]
7
10
  - Merge pull request #7 from tongueroo/clean: aws-ec2 clean ami command
8
11
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aws-ec2 (1.3.0)
4
+ aws-ec2 (1.3.1)
5
5
  activesupport
6
6
  aws-sdk-ec2
7
7
  aws-sdk-s3
@@ -3,18 +3,18 @@ module AwsEc2::Cleaner
3
3
  include AwsEc2::AwsService
4
4
 
5
5
  def clean
6
- query = @options[:query] + "*" # use query as base of name for search
6
+ query = @options[:query]
7
7
  keep = @options[:keep] || 2
8
8
  puts "Cleaning out old AMIs with base name: #{@options[:query]}"
9
9
  return if ENV['TEST']
10
10
 
11
11
  images = search_ami(query)
12
- images.sort_by! { |i| i.name }.reverse
12
+ images = images.sort_by { |i| i.name }.reverse
13
13
  delete_list = images[keep..-1] || []
14
14
  puts "Deleting #{delete_list.size} images."
15
15
  delete_list.each do |i|
16
16
  puts "Deleting image: #{i.image_id} #{i.name}"
17
- delete(i.image_id)
17
+ # delete(i.image_id)
18
18
  end
19
19
  end
20
20
 
@@ -1,7 +1,7 @@
1
1
  Examples:
2
2
 
3
- $ aws-ec2 clean ami base-amazonlinux2
4
- $ aws-ec2 clean ami base-ubuntu --keep 5
3
+ $ aws-ec2 clean ami 'base-amazonlinux2*'
4
+ $ aws-ec2 clean ami 'base-ubuntu*' --keep 5
5
5
 
6
6
  Deletes old AMIs using the provided name as the base portion of the AMI name to search for.
7
7
 
@@ -16,6 +16,6 @@ Let's say you have these images:
16
16
 
17
17
  Running:
18
18
 
19
- $ aws-ec2 clean ami base-ubuntu
19
+ $ aws-ec2 clean ami 'base-ubuntu*'
20
20
 
21
- Would delete all images and keep the 2 most recent AMIs. The default `--keep` value is 2.
21
+ Would delete all images and keep the 2 most recent AMIs. The default `--keep` value is 2. Make sure to surround the query pattern with a single quote to prevent shell glob expansion.
@@ -1,3 +1,3 @@
1
1
  module AwsEc2
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen