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 +4 -4
- data/bin/cf +2 -1
- data/lib/awful/changesets.rb +79 -0
- data/lib/awful/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 622d4c4ff51326df52dbfeb0df618e454c7fcf88
|
4
|
+
data.tar.gz: c8d362058239b2aa7258a6fe47f8b469e81e6c7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7695e14f3e3fadc9eae52e3e56d7c613adc25f95f9d6d1b28f00fbb97f69d22f6d471436c99418788e920c1855cfaf56bb97c3783d94c6c772aaf37d794e6a18
|
7
|
+
data.tar.gz: 9beea834bd0907f725153d729a26378902fe0915de60b78c6577193466b75213bcdf0588aaa192deb81dbb83435ced9cef0cbd714fb552c0c5a5b871896c6af1
|
data/bin/cf
CHANGED
@@ -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
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.
|
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-
|
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
|