awful 0.0.104 → 0.0.105

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
  SHA1:
3
- metadata.gz: 5329cca0c6c6012b2450a3f196a88fe6fc78a792
4
- data.tar.gz: cb467149ef90abfb695b6b508c800924875de07f
3
+ metadata.gz: 622d4c4ff51326df52dbfeb0df618e454c7fcf88
4
+ data.tar.gz: c8d362058239b2aa7258a6fe47f8b469e81e6c7b
5
5
  SHA512:
6
- metadata.gz: 8bb41e808668e4fecc69ac6d9c5502675ef336ce7219a10a801180ae178dcb9e28117963d07ffde578b7fb43949256c02ecf9a852ec7fa1da3696f919f009558
7
- data.tar.gz: f49db49a66e70a0ebeb2bb3544cbc89eccd2cc5bea371f742719f729a6ba1aae6f7b471be535a4b934b11f6c2ec4509820d1ffab9d083bc11bf78596cd468c64
6
+ metadata.gz: 7695e14f3e3fadc9eae52e3e56d7c613adc25f95f9d6d1b28f00fbb97f69d22f6d471436c99418788e920c1855cfaf56bb97c3783d94c6c772aaf37d794e6a18
7
+ data.tar.gz: 9beea834bd0907f725153d729a26378902fe0915de60b78c6577193466b75213bcdf0588aaa192deb81dbb83435ced9cef0cbd714fb552c0c5a5b871896c6af1
data/bin/cf CHANGED
@@ -3,5 +3,6 @@
3
3
 
4
4
  require 'awful'
5
5
  require 'awful/cloudformation'
6
+ require 'awful/changesets'
6
7
 
7
- Awful::CloudFormation.start(ARGV)
8
+ Awful::CloudFormation.start(ARGV)
@@ -0,0 +1,79 @@
1
+ module Awful
2
+ module Short
3
+ def changesets(*args)
4
+ Awful::Changesets.new.invoke(*args)
5
+ end
6
+ end
7
+
8
+ class Changesets < Thor
9
+ COLORS = {
10
+ create_in_progress: :yellow,
11
+ delete_in_progress: :yellow,
12
+ update_in_progress: :yellow,
13
+ update_complete_cleanup_in_progress: :yellow,
14
+ create_failed: :red,
15
+ delete_failed: :red,
16
+ update_failed: :red,
17
+ create_complete: :green,
18
+ delete_complete: :green,
19
+ update_complete: :green,
20
+ delete_skipped: :yellow,
21
+ rollback_in_progress: :red,
22
+ rollback_complete: :red,
23
+ add: :green,
24
+ modify: :yellow,
25
+ remove: :red,
26
+ }
27
+
28
+ no_commands do
29
+ def cf
30
+ @cf ||= Aws::CloudFormation::Client.new
31
+ end
32
+
33
+ def color(string)
34
+ set_color(string, COLORS.fetch(string.downcase.to_sym, :blue))
35
+ end
36
+ end
37
+
38
+ desc 'ls STACK_NAME', 'list change sets for stack'
39
+ method_option :long, aliases: '-l', default: false, desc: 'Long listing'
40
+ def ls(stack_name)
41
+ cf.list_change_sets(stack_name: stack_name).summaries.tap do |list|
42
+ if options[:long]
43
+ print_table list.map { |cs|
44
+ [
45
+ cs.change_set_name,
46
+ color(cs.status),
47
+ cs.creation_time
48
+ ]
49
+ }
50
+ else
51
+ puts list.map(&:stack_name)
52
+ end
53
+ end
54
+ end
55
+
56
+ desc 'changes STACK_NAME CHANGE_SET_NAME', 'list changes for the change set'
57
+ def changes(stack_name, change_set_name)
58
+ cf.describe_change_set(stack_name: stack_name, change_set_name: change_set_name).changes.tap do |changes|
59
+ print_table changes.map { |change|
60
+ rc = change.resource_change
61
+ [
62
+ color(rc.action),
63
+ rc.logical_resource_id,
64
+ rc.physical_resource_id,
65
+ rc.resource_type,
66
+ rc.replacement
67
+ ]
68
+ }
69
+ end
70
+
71
+ end
72
+ end
73
+
74
+ ## add as a subcommand of `cf`
75
+ class CloudFormation < Cli
76
+ desc 'changesets', 'control changesets'
77
+ subcommand 'changesets', Changesets
78
+ end
79
+ end
data/lib/awful/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.104'
2
+ VERSION = '0.0.105'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.104
4
+ version: 0.0.105
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-21 00:00:00.000000000 Z
11
+ date: 2016-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -147,6 +147,7 @@ files:
147
147
  - lib/awful/ami.rb
148
148
  - lib/awful/auto_scaling.rb
149
149
  - lib/awful/auto_scaling_notifications.rb
150
+ - lib/awful/changesets.rb
150
151
  - lib/awful/cloudformation.rb
151
152
  - lib/awful/datapipeline.rb
152
153
  - lib/awful/dynamodb.rb