awful 0.0.171 → 0.0.172
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.rb +7 -1
- data/lib/awful/ecr.rb +3 -2
- data/lib/awful/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 11f3cb0c491ac167ce83ba7326586888a905752f
|
|
4
|
+
data.tar.gz: c2801481c9b3c861b41ec6e4441bb9c853883c59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8fb2c497bddc4ea72cd40ed37dd0bf08c824cd4acb44aba51120ff0768064ae029485ad194fc968e159403850a67d233cbd680bd82fb6ecf4b14c94730ac9b81
|
|
7
|
+
data.tar.gz: 8e89918143775690bdd23bca9060198e54c68916bdc20d048116a7c4544df8846f18f14732a59cffdcf6eb8b571e5bef440d9a852937df90c423c1c6c82e51b4
|
data/lib/awful.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'awful/version'
|
|
2
2
|
|
|
3
3
|
require 'dotenv'
|
|
4
4
|
require 'aws-sdk'
|
|
@@ -18,6 +18,7 @@ module Awful
|
|
|
18
18
|
class Cli < Thor
|
|
19
19
|
class_option :env, aliases: '-e', type: :string, default: nil, desc: 'Load environment variables from file'
|
|
20
20
|
class_option :quiet, aliases: '-q', type: :boolean, default: false, desc: 'Quieten output'
|
|
21
|
+
class_option :yes, type: :boolean, default: false, desc: 'Always answer yes to prompts'
|
|
21
22
|
class_option :region, type: :string, default: nil, desc: 'Set region; can use AWS_REGION instead'
|
|
22
23
|
|
|
23
24
|
def initialize(args = [], local_options = {}, config = {})
|
|
@@ -27,6 +28,11 @@ module Awful
|
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
no_commands do
|
|
31
|
+
## override thor yes? method to handle our yes option
|
|
32
|
+
def yes?(statement, color = nil)
|
|
33
|
+
options[:yes] ? say("#{statement} yes", color) : super(statement, color)
|
|
34
|
+
end
|
|
35
|
+
|
|
30
36
|
def ec2
|
|
31
37
|
@ec2 ||= Aws::EC2::Client.new
|
|
32
38
|
end
|
data/lib/awful/ecr.rb
CHANGED
|
@@ -78,15 +78,16 @@ module Awful
|
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
desc 'login [REGISTRIES]', 'run docker login for registry'
|
|
81
|
-
method_option :email,
|
|
81
|
+
method_option :email, type: :string, default: nil, desc: 'Email for docker login command'
|
|
82
82
|
method_option :print, aliases: '-p', type: :boolean, default: false, desc: 'Print docker login command instead of running it'
|
|
83
83
|
def login(*registries)
|
|
84
84
|
cmd = options[:print] ? :puts : :system
|
|
85
85
|
registries = nil if registries.empty?
|
|
86
|
+
email = options[:email] ? "-e #{options[:email]}" : '' # -e deprecated as of 1.14, here for older docker clients
|
|
86
87
|
ecr.get_authorization_token(registry_ids: registries).authorization_data.output do |auths|
|
|
87
88
|
auths.each do |auth|
|
|
88
89
|
user, pass = Base64.decode64(auth.authorization_token).split(':')
|
|
89
|
-
send(cmd, "docker login -u #{user} -p #{pass}
|
|
90
|
+
send(cmd, "docker login -u #{user} -p #{pass} #{email} #{auth.proxy_endpoint}")
|
|
90
91
|
end
|
|
91
92
|
end
|
|
92
93
|
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.172
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ric Lister
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-04-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|