awful 0.0.71 → 0.0.72

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: 03463a7d6e810bc35c1e6046e1c7146f169c6c3b
4
- data.tar.gz: b2fb9f9635cee738269536462100adf340afb3ea
3
+ metadata.gz: 652eff8eaca66cd291cd19e02f272c910d0a06a9
4
+ data.tar.gz: 7510d7d64666cd742609cdd0b63d81665971678c
5
5
  SHA512:
6
- metadata.gz: 080d501cbb006811a5d344975f1f8ffb25ba571eab9924c3f576ff1b7da6eddd69eb4db7264f07ef1d1d58e712301aa83325591bb8846218dc5a850396a2a0aa
7
- data.tar.gz: 340922621b2549bd82b732c5737871685401492096f647e671149e00eef66ec977f618699d9196af8a7f479fee098f11b6c5af56f862d781d292e82423d43274
6
+ metadata.gz: e00b0049226d5881af8d25739877b81c787a62a8250f561962f760896103c2f5e4297c9f562c6780ad69e06eb2ad3331531f235786c904715ba36b0ff8cad521
7
+ data.tar.gz: 1d7d0e6100b097bb2fd6529305bf169670719013ed8820028565daaf97467a2c5046ba5f37048e9e05ba334c5af9bf167cce7fe0252bae349f7e672fd9c69e4e
data/awful.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.7"
22
22
  spec.add_development_dependency "rake"
23
23
 
24
- spec.add_dependency('aws-sdk', '>= 2.1.12')
24
+ spec.add_dependency('aws-sdk', '>= 2.2.8')
25
25
  spec.add_dependency('thor')
26
26
  spec.add_dependency('dotenv')
27
27
  end
data/bin/ecr ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby
2
+ #-*- mode: ruby; -*-
3
+
4
+ require 'awful'
5
+ require 'awful/ecr'
6
+
7
+ Awful::ECR.start(ARGV)
@@ -113,9 +113,9 @@ module Awful
113
113
  method_option :long, aliases: '-l', default: false, desc: 'Long listing'
114
114
  method_option :type, aliases: '-t', default: '.', desc: 'Filter by regex matching type of resource'
115
115
  def resources(name)
116
- ## first stack matching name
116
+ ## get first stack beginning with name
117
117
  stack = cf.list_stacks.stack_summaries.select do |stack|
118
- stack.stack_name.match(name)
118
+ stack.stack_name.match(/^#{name}/)
119
119
  end.first
120
120
 
121
121
  ## bail if no stack found with this name
data/lib/awful/ecr.rb ADDED
@@ -0,0 +1,53 @@
1
+ require 'base64'
2
+
3
+ module Awful
4
+
5
+ class ECR < Cli
6
+
7
+ no_commands do
8
+ def ecr
9
+ @ecr ||= Aws::ECR::Client.new
10
+ end
11
+ end
12
+
13
+ desc 'ls', 'list commands'
14
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
15
+ def ls
16
+ ecr.describe_repositories.repositories.tap do |repos|
17
+ if options[:long]
18
+ print_table repos.map { |r| [r.repository_name, r.registry_id, r.repository_arn] }
19
+ else
20
+ puts repos.map(&:repository_name)
21
+ end
22
+ end
23
+ end
24
+
25
+ desc 'login [REGISTRIES]', 'run docker login for registry'
26
+ method_option :email, aliases: '-E', type: :string, default: 'none', desc: 'Email for docker login command'
27
+ method_option :print, aliases: '-p', type: :boolean, default: false, desc: 'Print docker login command instead of running it'
28
+ def login(*registries)
29
+ cmd = options[:print] ? :puts : :system
30
+ registries = nil if registries.empty?
31
+ ecr.get_authorization_token(registry_ids: registries).authorization_data.tap do |auths|
32
+ auths.each do |auth|
33
+ user, pass = Base64.decode64(auth.authorization_token).split(':')
34
+ send(cmd, "docker login -u #{user} -p #{pass} -e #{options[:email]} #{auth.proxy_endpoint}")
35
+ end
36
+ end
37
+ end
38
+
39
+ desc 'images REPO', 'list images for repo'
40
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'Long listing'
41
+ def images(repository)
42
+ ecr.list_images(repository_name: repository).image_ids.tap do |images|
43
+ if options[:long]
44
+ print_table images.map { |i| [i.image_tag, i.image_digest] }
45
+ else
46
+ puts images.map(&:image_tag)
47
+ end
48
+ end
49
+ end
50
+
51
+ end
52
+
53
+ end
data/lib/awful/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.71'
2
+ VERSION = '0.0.72'
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.71
4
+ version: 0.0.72
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-27 00:00:00.000000000 Z
11
+ date: 2015-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 2.1.12
47
+ version: 2.2.8
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 2.1.12
54
+ version: 2.2.8
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -92,6 +92,7 @@ executables:
92
92
  - dyn
93
93
  - dynstr
94
94
  - ec2
95
+ - ecr
95
96
  - ecs
96
97
  - elb
97
98
  - iam
@@ -123,6 +124,7 @@ files:
123
124
  - bin/dyn
124
125
  - bin/dynstr
125
126
  - bin/ec2
127
+ - bin/ecr
126
128
  - bin/ecs
127
129
  - bin/elb
128
130
  - bin/iam
@@ -146,6 +148,7 @@ files:
146
148
  - lib/awful/dynamodb.rb
147
149
  - lib/awful/dynamodb_streams.rb
148
150
  - lib/awful/ec2.rb
151
+ - lib/awful/ecr.rb
149
152
  - lib/awful/ecs.rb
150
153
  - lib/awful/elb.rb
151
154
  - lib/awful/iam.rb