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 +4 -4
- data/lib/awful/ecr.rb +33 -4
- data/lib/awful/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 642b80ad31e28e772b636409fa60e7444fd2e435
|
4
|
+
data.tar.gz: c84281290c10d3798398de92cc977bfe857c9a34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f4c0c43507ae8958c9e660ddf14f36a81c0619c6f966f9de44a46086d77ab5e65b3fcaa2842d064c846ea79a2c50c59b18b23d4397d90d0c27e1e322a452800
|
7
|
+
data.tar.gz: d0ba6ab751a8cfb9dd44099a425bb229244a99c8d95dbfea3dc78d5ce438c3205ca21d4a4503da7a8e6afc4b07ea675b3bd7c8e956c19b2b331814c9481a4e02
|
data/lib/awful/ecr.rb
CHANGED
@@ -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
|
data/lib/awful/version.rb
CHANGED