awful 0.0.87 → 0.0.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb08d4b75da85cfb4f6f2b6f2676a8262ac9d474
4
- data.tar.gz: 441ceba1ce0b886929aa029cfd0bb48a97aeb82e
3
+ metadata.gz: 642b80ad31e28e772b636409fa60e7444fd2e435
4
+ data.tar.gz: c84281290c10d3798398de92cc977bfe857c9a34
5
5
  SHA512:
6
- metadata.gz: 1176e85a77999f0cbae504dbc4b66626d19bd8f3bc40e9623cb96aea81196a064dbe3445e96c0feba69b09effe22ca58b23b786b8075167198563943c84a7cbb
7
- data.tar.gz: 957e18c950e2ff839ce8874aad720bdc614e202ccd4dc083c96a740641cb6243acf620774a6c1f3106a04e725aef86078dd1b6abc7f6fbf7576c59ea3aaed71a
6
+ metadata.gz: 6f4c0c43507ae8958c9e660ddf14f36a81c0619c6f966f9de44a46086d77ab5e65b3fcaa2842d064c846ea79a2c50c59b18b23d4397d90d0c27e1e322a452800
7
+ data.tar.gz: d0ba6ab751a8cfb9dd44099a425bb229244a99c8d95dbfea3dc78d5ce438c3205ca21d4a4503da7a8e6afc4b07ea675b3bd7c8e956c19b2b331814c9481a4e02
@@ -1,9 +1,7 @@
1
1
  require 'base64'
2
2
 
3
3
  module Awful
4
-
5
4
  class ECR < Cli
6
-
7
5
  no_commands do
8
6
  def ecr
9
7
  @ecr ||= Aws::ECR::Client.new
@@ -22,6 +20,39 @@ module Awful
22
20
  end
23
21
  end
24
22
 
23
+ desc 'dump [REPOS]', 'describe given or all repositories as yaml'
24
+ def dump(*repos)
25
+ repos = nil if repos.empty? # omit this arg to show all repos
26
+ ecr.describe_repositories(repository_names: repos).repositories.tap do |list|
27
+ list.each do |repo|
28
+ puts YAML.dump(stringify_keys(repo.to_h))
29
+ end
30
+ end
31
+ end
32
+
33
+ desc 'create REPO', 'create a repository'
34
+ def create(repository)
35
+ ecr.create_repository(repository_name: repository)
36
+ end
37
+
38
+ desc 'delete REPO', 'delete a repository'
39
+ method_option :force, aliases: '-f', type: :boolean, default: false, desc: 'Force the deletion of the repository if it contains images'
40
+ def delete(repository)
41
+ if yes? "Really delete repository #{repository}?", :yellow
42
+ ecr.delete_repository(repository_name: repository, force: options[:force])
43
+ end
44
+ end
45
+
46
+ desc 'auth [REGISTRIES]', 'dump authorization details for registries (or default)'
47
+ def auth(*registries)
48
+ registries = nil if registries.empty?
49
+ ecr.get_authorization_token(registry_ids: registries).authorization_data.tap do |auths|
50
+ auths.each do |auth|
51
+ puts YAML.dump(stringify_keys(auth.to_h))
52
+ end
53
+ end
54
+ end
55
+
25
56
  desc 'login [REGISTRIES]', 'run docker login for registry'
26
57
  method_option :email, aliases: '-E', type: :string, default: 'none', desc: 'Email for docker login command'
27
58
  method_option :print, aliases: '-p', type: :boolean, default: false, desc: 'Print docker login command instead of running it'
@@ -47,7 +78,5 @@ module Awful
47
78
  end
48
79
  end
49
80
  end
50
-
51
81
  end
52
-
53
82
  end
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.87'
2
+ VERSION = '0.0.88'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.87
4
+ version: 0.0.88
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister