rake_docker 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -1
- data/lib/rake_docker.rb +1 -0
- data/lib/rake_docker/authentication.rb +1 -0
- data/lib/rake_docker/authentication/ecr.rb +36 -0
- data/lib/rake_docker/tasks/push.rb +3 -2
- data/lib/rake_docker/tasks/tag.rb +3 -2
- data/lib/rake_docker/version.rb +1 -1
- data/rake_docker.gemspec +1 -0
- metadata +17 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15b06409c03c10611901780de85a363a876ccbce
|
4
|
+
data.tar.gz: 7dacecfc4fd004f972c8618b75a7ba0418147c18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fe41972b3bb07394b3c0b57decaae0419dc7c0dd460e7eb7ff16ddeeed9d04f0a1d1688bb0401ea87979934214277f6a725c071f7bec28318c4b131998121ed
|
7
|
+
data.tar.gz: de19fe671a6e22ace1b5b273f8bd8380187073937ad9a682bc6304f3d34768ab71cfefb19d381439815f006f42568d1fc90d8e753f4b3f02356454eb39dbeeb5
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rake_docker (0.
|
4
|
+
rake_docker (0.7.0)
|
5
|
+
aws-sdk (~> 2.10)
|
5
6
|
docker-api (~> 1.33)
|
6
7
|
|
7
8
|
GEM
|
@@ -12,6 +13,14 @@ GEM
|
|
12
13
|
minitest (~> 5.1)
|
13
14
|
thread_safe (~> 0.3, >= 0.3.4)
|
14
15
|
tzinfo (~> 1.1)
|
16
|
+
aws-sdk (2.10.9)
|
17
|
+
aws-sdk-resources (= 2.10.9)
|
18
|
+
aws-sdk-core (2.10.9)
|
19
|
+
aws-sigv4 (~> 1.0)
|
20
|
+
jmespath (~> 1.0)
|
21
|
+
aws-sdk-resources (2.10.9)
|
22
|
+
aws-sdk-core (= 2.10.9)
|
23
|
+
aws-sigv4 (1.0.0)
|
15
24
|
diff-lcs (1.3)
|
16
25
|
docile (1.1.5)
|
17
26
|
docker-api (1.33.6)
|
@@ -20,6 +29,7 @@ GEM
|
|
20
29
|
excon (0.57.1)
|
21
30
|
gem-release (0.7.4)
|
22
31
|
i18n (0.8.4)
|
32
|
+
jmespath (1.3.1)
|
23
33
|
json (2.1.0)
|
24
34
|
memfs (1.0.0)
|
25
35
|
minitest (5.10.2)
|
data/lib/rake_docker.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
require_relative 'authentication/ecr'
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'aws-sdk'
|
2
|
+
require 'ostruct'
|
3
|
+
|
4
|
+
module RakeDocker
|
5
|
+
module Authentication
|
6
|
+
class ECR
|
7
|
+
def initialize &block
|
8
|
+
config = OpenStruct.new(
|
9
|
+
region: nil,
|
10
|
+
registry_id: nil)
|
11
|
+
block.call(*[config].slice(0, block.arity))
|
12
|
+
|
13
|
+
@ecr_client = Aws::ECR::Client.new(region: config.region)
|
14
|
+
|
15
|
+
@registry_id = config.registry_id.respond_to?(:call) ?
|
16
|
+
config.registry_id.call :
|
17
|
+
config.registry_id
|
18
|
+
end
|
19
|
+
|
20
|
+
def call
|
21
|
+
token_response = @ecr_client.get_authorization_token(
|
22
|
+
registry_ids: [@registry_id])
|
23
|
+
token_data = token_response.authorization_data[0]
|
24
|
+
proxy_endpoint = token_data.proxy_endpoint
|
25
|
+
email = 'none'
|
26
|
+
username, password =
|
27
|
+
Base64.decode64(token_data.authorization_token).split(':')
|
28
|
+
|
29
|
+
{
|
30
|
+
username: username, password: password, email: email,
|
31
|
+
serveraddress: proxy_endpoint
|
32
|
+
}
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'docker'
|
2
|
+
require 'ostruct'
|
2
3
|
require_relative '../tasklib'
|
3
4
|
|
4
5
|
module RakeDocker
|
@@ -19,12 +20,12 @@ module RakeDocker
|
|
19
20
|
def define
|
20
21
|
desc "Push #{image_name} image to repository"
|
21
22
|
task name do
|
22
|
-
params = OpenStruct.new(
|
23
|
+
params = OpenStruct.new(
|
23
24
|
image_name: image_name,
|
24
25
|
repository_url: repository_url,
|
25
26
|
credentials: credentials,
|
26
27
|
tag: tags
|
27
|
-
|
28
|
+
)
|
28
29
|
|
29
30
|
derived_repository_url = repository_url.respond_to?(:call) ?
|
30
31
|
repository_url.call(*[params].slice(0, repository_url.arity)) :
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'docker'
|
2
|
+
require 'ostruct'
|
2
3
|
require_relative '../tasklib'
|
3
4
|
|
4
5
|
module RakeDocker
|
@@ -19,10 +20,10 @@ module RakeDocker
|
|
19
20
|
def define
|
20
21
|
desc "Tag #{image_name} image for repository"
|
21
22
|
task name do
|
22
|
-
params = OpenStruct.new(
|
23
|
+
params = OpenStruct.new(
|
23
24
|
image_name: image_name,
|
24
25
|
repository_name: repository_name
|
25
|
-
|
26
|
+
)
|
26
27
|
|
27
28
|
derived_repository_url = repository_url.respond_to?(:call) ?
|
28
29
|
repository_url.call(*[params].slice(0, repository_url.arity)) :
|
data/lib/rake_docker/version.rb
CHANGED
data/rake_docker.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.required_ruby_version = '>= 2.0'
|
25
25
|
|
26
26
|
spec.add_dependency 'docker-api', '~> 1.33'
|
27
|
+
spec.add_dependency 'aws-sdk', '~> 2.10'
|
27
28
|
|
28
29
|
spec.add_development_dependency 'bundler', '~> 1.14'
|
29
30
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake_docker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toby Clemson
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.33'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: aws-sdk
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.10'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.10'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,6 +156,8 @@ files:
|
|
142
156
|
- bin/console
|
143
157
|
- bin/setup
|
144
158
|
- lib/rake_docker.rb
|
159
|
+
- lib/rake_docker/authentication.rb
|
160
|
+
- lib/rake_docker/authentication/ecr.rb
|
145
161
|
- lib/rake_docker/exceptions.rb
|
146
162
|
- lib/rake_docker/tasklib.rb
|
147
163
|
- lib/rake_docker/tasks.rb
|